From 8821917d493523aaca4d14be670977d9760176b7 Mon Sep 17 00:00:00 2001 From: Wesley Maxey <71408887+wmaxey@users.noreply.github.com> Date: Thu, 17 Oct 2024 13:23:06 -0700 Subject: [PATCH] Revert accidental force push to main. (#2596) * Revert "Tweaks to slack notifs." This reverts commit 0d475efd73b04adb988bd1dc67cf0b3d4d5fad9b. * Revert "Add slack notifications." This reverts commit 9551a53a0d3fb536d26fedbbe5b968252c54530b. * Revert "Use annotated tags." This reverts commit 5cd738c05d30f9f17a6b39c544bfc36f682c2c44. * Revert "Log archive sizes." This reverts commit 3ebd80420165aa42e4a0e317d8dfd9d1ccf5dccd. * Revert "Fix typo." This reverts commit 47fda9a526cb0a32ff23024454fdad94ab395dc8. * Revert "Add more useful display name to install preset." This reverts commit cdd367e9dc7fd4d51e42a772ed92b6b1a6fc4a4f. * Revert "Add overview doc for release workflows." This reverts commit a6af3bf6b3485b5f822183dfd67f23ba76234d7b. * Revert "Document workflow ref requirements/usage." This reverts commit 448da792eaf61e296131b03e4806fcaa189deb59. * Revert "Cleanup version handling in create-new." This reverts commit 75c250015c10dbcd91d67f854d0d4905adccec84. * Revert "Upload source packages, too." This reverts commit dde8e2ef2d25173683e57aea351aea8e352ffc58. * Revert "Verify the repo version in release-finalize." This reverts commit c05951a27cd63745436739d8d6beefbfda4b4d55. * Revert "Simply release branch creation." This reverts commit 4c7eacbc08545358bb5a3b6fd8f3b34b294d097d. * Revert "Refactor for consistency." This reverts commit ed46ca847f4883906298d8887dc9749e7270124e. * Revert "Infer version in RC workflow from repo/git state." This reverts commit ea07539c0d01f9bccd5189d4210f624673c97665. * Revert "Add json file with version info that we can parse in CI." This reverts commit 0beede5c2968a29af550b84a805b823e87883071. * Revert "Release workflow updates:" This reverts commit 2873882e93b6c8ee3891dd4748c7df9cc2c337db. * Revert "Add `install` preset." This reverts commit 14d95a4297797cf95b20df421538cebee875dea7. * Revert "Add reusable workflow for updating version in branch with a PR" This reverts commit 70a2872bcd6d18e926717abd5739851f28754476. * Revert "Add release automation workflows." This reverts commit 43eb66afc7d437724e8b05a560fc3ab1f26e4b09. --- .github/workflows/release-README.md | 65 ----- .github/workflows/release-create-new.yml | 199 --------------- .github/workflows/release-finalize.yml | 196 --------------- .github/workflows/release-update-rc.yml | 256 -------------------- .github/workflows/update-branch-version.yml | 148 ----------- CMakePresets.json | 29 --- cccl-version.json | 6 - ci/update_version.sh | 9 +- 8 files changed, 1 insertion(+), 907 deletions(-) delete mode 100644 .github/workflows/release-README.md delete mode 100644 .github/workflows/release-create-new.yml delete mode 100644 .github/workflows/release-finalize.yml delete mode 100644 .github/workflows/release-update-rc.yml delete mode 100644 .github/workflows/update-branch-version.yml delete mode 100644 cccl-version.json diff --git a/.github/workflows/release-README.md b/.github/workflows/release-README.md deleted file mode 100644 index de33e877584..00000000000 --- a/.github/workflows/release-README.md +++ /dev/null @@ -1,65 +0,0 @@ -# Release Workflows - -The three `release-*.yml` workflows are used at various points in the release process: - -## 1. `release-create-new.yml` - -Begin the release process for a new version. Create branches and update version numbers. - -### Start workflow on - -- The `branch/{major}.{minor}.x` branch if it exists for the target version, or -- The branch or tag to use as a base when forking the release branch (e.g. `main`) - -### Inputs - -- `branch_version`: The 'X.Y.Z' version to use for the release branch. -- `main_version`: Optional; If set, a pull request will be created to bump main to this `X.Y.Z` version. - -### Actions - -- Creates release branch if needed. -- Updates release version directly on github release branch. -- If requested, creates pull request to update main to `main_version`. - -## 2. `release-update-rc.yml` - -Test and tag a new release candidate from a prepared release branch. - -### Start workflow on - -The release branch that has been prepared for the release candidate. -The current HEAD commit will be used. - -### Inputs - -None. The version number is obtained from inspecting the repository state. - -### Actions - -- Reads the version from a new metadata file written by the update-version.sh script. -- Errors out if the version is already tagged. -- Determines the next rc for this version by inspecting existing tags. -- Runs the `pull_request` workflow to validate the release candidate. - This can be modified in the future to run a special rc acceptance workflow (sanitizers, benchmarks?). -- Tags the release candidate only if the CI workflow passes. - -## `release-finalize` - -Tag a final release from an existing release candidate. -Create release artifacts. - -### Start workflow on - -The release candidate tag to use for the final release. - -### Inputs - -None. - -### Actions - -- Parses version info from the provided tag. -- Pushes final release tag -- Generates source and install packages (zips and tgzs) -- Creates draft Github release with auto-generated release notes and source/install archives. diff --git a/.github/workflows/release-create-new.yml b/.github/workflows/release-create-new.yml deleted file mode 100644 index a91265b9882..00000000000 --- a/.github/workflows/release-create-new.yml +++ /dev/null @@ -1,199 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: "Release: 1. Begin Release Cycle" - -# The branch or tag selected when starting the workflow should be: -# 1. "branch/{major}.{minor}.x" if it exists, or -# 2. The ref to use when branching the release branch. - -on: - workflow_dispatch: - inputs: - branch_version: - description: "Version 'X.Y.Z' for the release branch." - type: string - required: true - main_version: - description: "If set, open PR to update `main` to version 'X.Y.Z'." - type: string - required: false - -defaults: - run: - shell: bash --noprofile --norc -euo pipefail {0} - -jobs: - create-release-branch: - permissions: - contents: write - pull-requests: write - runs-on: ubuntu-latest - steps: - - name: Prepare environment - id: prepare-env - run: | - log_and_export_vars() { - for var in "$@"; do - printf "%-15s %s\n" "$var:" "${!var}" | tee -a $GITHUB_STEP_SUMMARY - echo "${var}=${!var}" | tee -a $GITHUB_ENV | tee -a $GITHUB_OUTPUT - done - } - - full_version=${{ inputs.branch_version }} - major_version=$(echo ${full_version} | cut -d. -f1) - minor_version=$(echo ${full_version} | cut -d. -f2) - patch_version=$(echo ${full_version} | cut -d. -f3) - branch_name="branch/${major_version}.${minor_version}.x" - - main_version=${{ inputs.main_version }} - main_major_version=$(echo ${main_version} | cut -d. -f1) - main_minor_version=$(echo ${main_version} | cut -d. -f2) - main_patch_version=$(echo ${main_version} | cut -d. -f3) - - log_and_export_vars \ - full_version major_version minor_version patch_version \ - main_version main_major_version main_minor_version main_patch_version \ - branch_name - - echo "Branch ref: $GITHUB_REF" | tee -a $GITHUB_STEP_SUMMARY - echo "Branch SHA: $GITHUB_SHA" | tee -a $GITHUB_STEP_SUMMARY - echo "Branch commit: $(git show --oneline --no-patch ${GITHUB_SHA})" | tee -a $GITHUB_STEP_SUMMARY - - - name: Verify environment - run: | - # If the release branch already exists, it must match the branch point: - if git ls-remote --exit-code origin $branch_name; then - if [[ $GITHUB_REF != refs/heads/$branch_name ]]; then - echo "Branch $branch_name already exists but does not match GITHUB_REF:" | tee -a $GITHUB_STEP_SUMMARY - echo " GITHUB_REF: $GITHUB_REF" | tee -a $GITHUB_STEP_SUMMARY - echo " branch_name: $branch_name" | tee -a $GITHUB_STEP_SUMMARY - echo "This workflow must be run from the release branch if it already exists." - exit 1 - fi - fi - - if [[ ! $full_version =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - echo "Invalid version number: $full_version" - exit 1 - fi - - # Main version may be empty: - if [[ -n $main_version ]]; then - if [[ ! $main_version =~ ^[0-9]+\.[0-9]+\.[0-9]*$ ]]; then - echo "Invalid main version number: $main_version" - exit 1 - fi - fi - - - name: Checkout the repository - uses: actions/checkout@v4 - with: - persist-credentials: false - - - name: Create release branch if needed - id: create_branch - run: | - if git ls-remote --exit-code origin $branch_name; then - echo "Branch $branch_name already exists:" | tee -a $GITHUB_STEP_SUMMARY - else - git push origin ${GITHUB_SHA}:$branch_name - echo "Created branch $branch_name at:" | tee -a $GITHUB_STEP_SUMMARY - fi - - git show --oneline --no-patch HEAD | tee -a $GITHUB_STEP_SUMMARY - - - name: Update version numbers in release branch - run: | - git checkout $GITHUB_SHA - echo "::group::Running update-version.sh" - ./ci/update-version.sh ${major_version} ${minor_version} ${patch_version} - echo "::endgroup::" - - if ! git diff --quiet; then - echo "::group::Diff" - git diff - echo "::endgroup::" - - git add . - git commit -m "Bump ${branch_name} to ${full_version}." - - # Push the changes to the release branch: - git push --no-ff origin ${branch_name}:${branch_name} - fi - - - name: Update version numbers in `main` - if: ${{ inputs.main_version }} - run: | - git checkout main - topic_branch=bump_version_${main_version} - git checkout -b ${topic_branch} - - echo "::group::Running update-version.sh" - ./ci/update-version.sh ${main_major_version} ${main_minor_version} ${main_patch_version} - echo "::endgroup::" - - if ! git diff --quiet; then - echo "::group::Diff" - git diff - echo "::endgroup::" - - git add . - git commit -m "Bump main branch to ${main_version}." - git push origin ${topic_branch}:${topic_branch} - fi - - - name: Create a pull request for `main` version update - if: ${{ inputs.main_version }} - id: create_pr - uses: peter-evans/create-pull-request@v5 - with: - branch: bump_version_${{ inputs.main_version }} - title: 'Bump `main` branch to version ${{ inputs.main_version }}' - body: 'This PR was automatically generated by the release-create-new workflow.' - base: main - - - name: Notify Slack - if: ${{ success()}} - uses: slackapi/slack-github-action@v1.26.0 - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFIER_BOT_TOKEN }} - SUMMARY_URL: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} - BRANCH_NAME: ${{ steps.prepare-env.outputs.branch_name }} - BRANCH_VERSION: ${{ inputs.branch_version }} - MAIN_VERSION: ${{ inputs.main_version }} - MAIN_PR_URL: ${{ steps.create_pr.outputs.pull-request-url }} - with: - channel-id: ${{ secrets.SLACK_CHANNEL_RELEASE_LOG }} - slack-message: | - A new release cycle has started for `v${{ env.BRANCH_VERSION }}` on `${{ env.BRANCH_NAME }}`. - - If requested, a PR to update `main` to `v${{ env.MAIN_VERSION }}` has been created: ${{ env.MAIN_PR_URL }}. - - Workflow summary: ${{ env.SUMMARY_URL }} - - - name: Notify Slack (failure) - if: ${{ failure() }} - uses: slackapi/slack-github-action@v1.26.0 - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFIER_BOT_TOKEN }} - SUMMARY_URL: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} - BRANCH_VERSION: ${{ inputs.branch_version }} - with: - channel-id: ${{ secrets.SLACK_CHANNEL_RELEASE_LOG }} - slack-message: | - An error has occurred while initiating a new release cycle for `v${{ env.BRANCH_VERSION }}`. - - Details: ${{ env.SUMMARY_URL }} diff --git a/.github/workflows/release-finalize.yml b/.github/workflows/release-finalize.yml deleted file mode 100644 index 307ab92315a..00000000000 --- a/.github/workflows/release-finalize.yml +++ /dev/null @@ -1,196 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: "Release: 3. Create Final Release" - -# This workflow must be started on an release candidate tag. - -on: - workflow_dispatch: - -defaults: - run: - shell: bash --noprofile --norc -euo pipefail {0} - -jobs: - create-release: - runs-on: ubuntu-latest - permissions: - contents: write - outputs: - rc_tag: ${{ steps.prepare.outputs.rc_tag }} - release_tag: ${{ steps.prepare.outputs.release_tag }} - steps: - - name: Checkout the repository - uses: actions/checkout@v4 - with: - persist-credentials: false - - name: Prepare environment - id: prepare - run: | - log_and_export_vars() { - for var in "$@"; do - printf "%-15s %s\n" "$var:" "${!var}" | tee -a $GITHUB_STEP_SUMMARY - echo "${var}=${!var}" | tee -a $GITHUB_ENV | tee -a $GITHUB_OUTPUT - done - } - - # The ref must match a release candidate tag. Parse version info: - tag_regex="^refs/tags/v([0-9]+)\.([0-9]+)\.([0-9]+)-rc([0-9]+)$" - if [[ "${GITHUB_REF}" =~ ${tag_regex} ]]; then - major_version=${BASH_REMATCH[1]} - minor_version=${BASH_REMATCH[2]} - patch_version=${BASH_REMATCH[3]} - rc=${BASH_REMATCH[4]} - else - echo "::error::Invalid ref: ${GITHUB_REF}. Must be a release candidate tag (vX.Y.Z-rcN)." - exit 1 - fi - full_version="${major_version}.${minor_version}.${patch_version}" - release_tag="v${full_version}" - rc_tag="${release_tag}-rc${rc}" - repo_version=$(jq -r .full cccl-version.json) - - log_and_export_vars full_version major_version minor_version patch_version rc release_tag rc_tag repo_version - - if [[ "${repo_version}" != "${full_version}" ]]; then - echo "::error::cccl-version.json (${repo_version}) does not match release candidate tag (${rc_tag})." - exit 1 - fi - - # Ensure that there is no final release tag (vX.Y.Z) for the requested version. - release_tag_escaped=$(echo "${release_tag}" | sed 's/\./\\./g') - if git ls-remote --tags origin | grep -q "refs/tags/${release_tag_escaped}$"; then - echo "::error::Final release tag ${release_tag} already exists." - exit 1 - fi - - - name: Generate archives - id: archive - run: | - source_base=cccl-src-${release_tag} - package_base=cccl-${release_tag} - - echo "::group::Preparing source" - declare -a source_exclude=( - .aws - .cache - .config - .local - .git - .vscode - build - archives - ${source_base} - ${package_base} - ) - mkdir ${source_base} - rsync -av ${source_exclude[*]/#/--exclude=} . ${source_base} - echo "::endgroup::" - - echo "::group::Configuring install" - cmake --preset install -DCMAKE_INSTALL_PREFIX=${package_base} - echo "::endgroup::" - - echo "::group::Installing" - pushd build/install - cmake --install . - popd - echo "::endgroup::" - - mkdir archives - - source_tarball=${PWD}/archives/${source_base}.tar.gz - source_zipfile=${PWD}/archives/${source_base}.zip - package_tarball=${PWD}/archives/${package_base}.tar.gz - package_zipfile=${PWD}/archives/${package_base}.zip - - echo "source_tarball=${source_tarball}" >> $GITHUB_ENV - echo "source_zipfile=${source_zipfile}" >> $GITHUB_ENV - echo "package_tarball=${package_tarball}" >> $GITHUB_ENV - echo "package_zipfile=${package_zipfile}" >> $GITHUB_ENV - - echo "::group::Archiving: ${source_tarball}" - tar -cvzf ${source_tarball} ${source_base} - echo "::endgroup::" - - echo "::group::Archiving: ${source_zipfile}" - zip -rv9 ${source_zipfile} ${source_base} - echo "::endgroup::" - - echo "::group::Archiving: ${package_tarball}" - tar -cvzf ${package_tarball} ${package_base} - echo "::endgroup::" - - echo "::group::Archiving: ${package_zipfile}" - zip -rv9 ${package_zipfile} ${package_base} - echo "::endgroup::" - - echo "::group::Archive vs Source Sizes" - echo "Sources:" | tee -a $GITHUB_STEP_SUMMARY - du -sh ${source_base} ${source_tarball} ${source_zipfile} | tee -a $GITHUB_STEP_SUMMARY - echo "Installation Packages:" | tee -a $GITHUB_STEP_SUMMARY - du -sh ${package_base} ${package_tarball} ${package_zipfile} | tee -a $GITHUB_STEP_SUMMARY - echo "::endgroup::" - - rm -rf ${source_base} ${package_base} - - - name: Tag - run: | - git tag -a -m "CCCL Release ${release_tag}" ${release_tag} ${rc_tag} - git push origin ${release_tag} - echo "Tagged release ${release_tag} from ${rc_tag}." | tee -a $GITHUB_STEP_SUMMARY - - - name: Draft Github Release - run: | - gh release create ${release_tag} \ - --draft \ - --generate-notes \ - --title "${release_tag}" \ - "${source_zipfile}#Source Archive (zip)" \ - "${source_tarball}#Source Archive (tar.gz)" \ - "${package_zipfile}#Installation Archive (zip)" \ - "${package_tarball}#Installation Archive (tar.gz)" - - - name: Notify Slack - if: ${{ success() }} - uses: slackapi/slack-github-action@v1.26.0 - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFIER_BOT_TOKEN }} - SUMMARY_URL: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} - RC_TAG: ${{ steps.prepare.outputs.rc_tag }} - RELEASE_TAG: ${{ steps.prepare.outputs.release_tag }} - RELEASE_URL: https://github.com/${{github.repository}}/releases/tag/${{ steps.prepare.outputs.release_tag }} - with: - channel-id: ${{ secrets.SLACK_CHANNEL_RELEASE_LOG }} - slack-message: | - Release `${{ env.RELEASE_TAG }}` has been created from `${{ env.RC_TAG }}`. - - A draft Github release has been prepared at ${{ env.RELEASE_URL }}. - - Workflow summary: ${{ env.SUMMARY_URL }} - - - name: Notify Slack (failure) - if: ${{ failure() }} - uses: slackapi/slack-github-action@v1.26.0 - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFIER_BOT_TOKEN }} - SUMMARY_URL: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} - with: - channel-id: ${{ secrets.SLACK_CHANNEL_RELEASE_LOG }} - slack-message: | - An error has occurred while creating a release from ${{ github.ref }}. - - Details: ${{ env.SUMMARY_URL }} diff --git a/.github/workflows/release-update-rc.yml b/.github/workflows/release-update-rc.yml deleted file mode 100644 index 988b87d5174..00000000000 --- a/.github/workflows/release-update-rc.yml +++ /dev/null @@ -1,256 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: "Release: 2. Test and Tag New RC" - -# This workflow must be started on the "branch/{major}.{minor}.x" release branch -# after the release-create-new workflow runs. - -on: - workflow_dispatch: - -defaults: - run: - shell: bash --noprofile --norc -euo pipefail {0} - -jobs: - prepare: - runs-on: ubuntu-latest - outputs: - tag_name: ${{ steps.prepare.outputs.tag_name }} - steps: - - name: Checkout the repository - uses: actions/checkout@v4 - with: - persist-credentials: false - - - name: Prepare environment - id: prepare - run: | - log_vars() { - for var in "$@"; do - printf "%-15s %s\n" "${var}:" "${!var}" | tee -a $GITHUB_STEP_SUMMARY - done - } - export_vars() { - for var in "$@"; do - echo "${var}=${!var}" | tee -a $GITHUB_ENV | tee -a $GITHUB_OUTPUT - done - } - - # Parse repo version info: - full_version=$(jq -r .full cccl-version.json) - major_version=$(jq -r .major cccl-version.json) - minor_version=$(jq -r .minor cccl-version.json) - patch_version=$(jq -r .patch cccl-version.json) - branch_name="branch/${major_version}.${minor_version}.x" - - log_vars full_version major_version minor_version patch_version branch_name GITHUB_REF GITHUB_SHA - export_vars full_version major_version minor_version patch_version branch_name - - - name: Validate versions and tags - run: | - # The workflow must be started on a release branch: - if [[ "${GITHUB_REF}" != "refs/heads/${branch_name}" ]]; then - echo "::error::GITHUB_REF (${GITHUB_REF}) does not match expected branch name (${branch_name})." - exit 1 - fi - - # The release tag must not exist: - full_version_escaped=$(echo "${full_version}" | sed 's/\./\\./g') - if git ls-remote --tags origin | grep -q "refs/tags/v${full_version_escaped}\$"; then - echo "::error::Tag v${full_version} already exists. Was the automated version-bump PR merged?" - exit 1 - fi - - # Look for previous release candidates: - declare -i last_rc=-1 - for tag in $(git ls-remote --tags origin); do - if [[ $tag =~ refs/tags/v${full_version_escaped}-rc([0-9]+)$ ]]; then - echo "Found prior release candidate: ${tag}" - rc=${BASH_REMATCH[1]} - if (( rc > last_rc )); then - last_rc=rc - fi - fi - done - - next_rc=$((last_rc + 1)) - tag_name="v${full_version}-rc${next_rc}" - - log_vars last_rc next_rc tag_name - export_vars tag_name - - build-workflow: - name: Build workflow from matrix - runs-on: ubuntu-latest - permissions: - contents: read - outputs: - workflow: ${{ steps.build-workflow.outputs.workflow }} - steps: - - name: Checkout repo - uses: actions/checkout@v4 - with: - persist-credentials: false - - name: Build workflow - id: build-workflow - uses: ./.github/actions/workflow-build - with: - workflows: pull_request #TODO could add more or create a new release_candidate approval workflow. - slack_token: ${{ secrets.SLACK_NOTIFIER_BOT_TOKEN }} - slack_log: ${{ secrets.SLACK_CHANNEL_RELEASE_LOG }} - - dispatch-groups-linux-two-stage: - name: ${{ matrix.name }} - if: ${{ toJSON(fromJSON(needs.build-workflow.outputs.workflow)['linux_two_stage']['keys']) != '[]' }} - needs: build-workflow - permissions: - id-token: write - contents: read - strategy: - fail-fast: false - matrix: - name: ${{ fromJSON(needs.build-workflow.outputs.workflow)['linux_two_stage']['keys'] }} - uses: ./.github/workflows/workflow-dispatch-two-stage-group-linux.yml - with: - pc-array: ${{ toJSON(fromJSON(needs.build-workflow.outputs.workflow)['linux_two_stage']['jobs'][matrix.name]) }} - - dispatch-groups-windows-two-stage: - name: ${{ matrix.name }} - if: ${{ toJSON(fromJSON(needs.build-workflow.outputs.workflow)['windows_two_stage']['keys']) != '[]' }} - needs: build-workflow - permissions: - id-token: write - contents: read - strategy: - fail-fast: false - matrix: - name: ${{ fromJSON(needs.build-workflow.outputs.workflow)['windows_two_stage']['keys'] }} - uses: ./.github/workflows/workflow-dispatch-two-stage-group-windows.yml - with: - pc-array: ${{ toJSON(fromJSON(needs.build-workflow.outputs.workflow)['windows_two_stage']['jobs'][matrix.name]) }} - - dispatch-groups-linux-standalone: - name: ${{ matrix.name }} - if: ${{ toJSON(fromJSON(needs.build-workflow.outputs.workflow)['linux_standalone']['keys']) != '[]' }} - needs: build-workflow - permissions: - id-token: write - contents: read - strategy: - fail-fast: false - matrix: - name: ${{ fromJSON(needs.build-workflow.outputs.workflow)['linux_standalone']['keys'] }} - uses: ./.github/workflows/workflow-dispatch-standalone-group-linux.yml - with: - job-array: ${{ toJSON(fromJSON(needs.build-workflow.outputs.workflow)['linux_standalone']['jobs'][matrix.name]) }} - - dispatch-groups-windows-standalone: - name: ${{ matrix.name }} - if: ${{ toJSON(fromJSON(needs.build-workflow.outputs.workflow)['windows_standalone']['keys']) != '[]' }} - needs: build-workflow - permissions: - id-token: write - contents: read - strategy: - fail-fast: false - matrix: - name: ${{ fromJSON(needs.build-workflow.outputs.workflow)['windows_standalone']['keys'] }} - uses: ./.github/workflows/workflow-dispatch-standalone-group-windows.yml - with: - job-array: ${{ toJSON(fromJSON(needs.build-workflow.outputs.workflow)['windows_standalone']['jobs'][matrix.name]) }} - - verify-workflow: - name: Verify and summarize workflow results - if: ${{ always() && !cancelled() }} - needs: - - build-workflow - - dispatch-groups-linux-two-stage - - dispatch-groups-windows-two-stage - - dispatch-groups-linux-standalone - - dispatch-groups-windows-standalone - permissions: - contents: read - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v4 - with: - persist-credentials: false - - - name: Check workflow success - id: check-workflow - uses: ./.github/actions/workflow-results - with: - slack_token: ${{ secrets.SLACK_NOTIFIER_BOT_TOKEN }} - slack_log: ${{ secrets.SLACK_CHANNEL_RELEASE_LOG }} - - tag: - needs: - - prepare - - verify-workflow - permissions: - contents: write - runs-on: ubuntu-latest - steps: - - name: Checkout the repository - uses: actions/checkout@v4 - with: - persist-credentials: false - - - name: Tag the release candidate - run: | - rc_tag=${{ needs.prepare.outputs.tag_name }} - git tag -a -m "CCCL Release Candidate ${rc_tag}" ${rc_tag} ${GITHUB_SHA} - git push origin ${rc_tag} - echo "Tagged release candidate ${rc_tag}." - - notify-success: - if: ${{ success() }} - needs: tag - runs-on: ubuntu-latest - steps: - - name: Notify Slack - uses: slackapi/slack-github-action@v1.26.0 - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFIER_BOT_TOKEN }} - SUMMARY_URL: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} - RC_TAG: ${{ needs.prepare.outputs.tag_name }} - with: - channel-id: ${{ secrets.SLACK_CHANNEL_RELEASE_LOG }} - slack-message: | - A new release candidate `${{ env.RC_TAG }}` has been tagged. - - Workflow summary: ${{ env.SUMMARY_URL }} - - notify-failure: - if: ${{ failure() }} - needs: tag - runs-on: ubuntu-latest - steps: - - name: Notify Slack (failure) - if: ${{ failure() }} - uses: slackapi/slack-github-action@v1.26.0 - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFIER_BOT_TOKEN }} - SUMMARY_URL: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} - RC_TAG: ${{ needs.prepare.outputs.tag_name }} - with: - channel-id: ${{ secrets.SLACK_CHANNEL_RELEASE_LOG }} - slack-message: | - An error has occurred while creating release candidate `${{ env.RC_TAG }}`. - - Details: ${{ env.SUMMARY_URL }} diff --git a/.github/workflows/update-branch-version.yml b/.github/workflows/update-branch-version.yml deleted file mode 100644 index 76f7581e3cd..00000000000 --- a/.github/workflows/update-branch-version.yml +++ /dev/null @@ -1,148 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: "Release: 0. Update version in target branch" - -# The target branch when starting this workflow should be: -# 1. "branch/{major}.{minor}.x" if it exists, or -# 2. "main" - -on: - workflow_dispatch: - inputs: - new_version: - description: "Version 'X.Y.Z' for the release branch." - type: string - required: true - default: "0.0.0" - target_branch: - description: "Target branch for the version update" - type: string - required: false - default: "main" - force: - description: "Enable overwriting existing PR branches (this does not force overwrite the target branch or skip creating a PR)" - type: boolean - required: true - default: false - -defaults: - run: - shell: bash --noprofile --norc -euo pipefail {0} - -jobs: - update-version: - permissions: - contents: write - pull-requests: write - runs-on: ubuntu-latest - env: - GH_TOKEN: ${{ github.token }} - steps: - - name: Checkout the repository - uses: actions/checkout@v4 - with: - ref: ${{ inputs.target_branch }} - - - name: Verify run from main - id: verify-main - run: | - # This action can only be run from main. - if [[ $GITHUB_REF != refs/heads/main ]]; then - echo " This action may only be run fom main" | tee -a $GITHUB_STEP_SUMMARY - exit 1 - fi - - - name: Prepare environment - id: prepare-env - run: | - log_and_export_vars() { - for var in "$@"; do - printf "%-15s %s\n" "$var:" "${!var}" | tee -a $GITHUB_STEP_SUMMARY - echo "${var}=${!var}" | tee -a $GITHUB_ENV | tee -a $GITHUB_OUTPUT - done - } - - full_version=${{ inputs.new_version }} - major_version=$(echo ${full_version} | cut -d. -f1) - minor_version=$(echo ${full_version} | cut -d. -f2) - patch_version=$(echo ${full_version} | cut -d. -f3) - branch_name=${{ inputs.target_branch }} - enable_force_push="${{ inputs.force }}" - pr_title="[Version] Update ${branch_name} to v${full_version}" - pr_body="Bump ${branch_name} to ${full_version}." - pr_branch="pr/ver/${branch_name}-v${full_version}" - - log_and_export_vars \ - full_version major_version minor_version patch_version \ - branch_name pr_title pr_branch pr_body enable_force_push - - echo "Branch ref: $GITHUB_REF" | tee -a $GITHUB_STEP_SUMMARY - echo "Branch SHA: $GITHUB_SHA" | tee -a $GITHUB_STEP_SUMMARY - echo "Branch commit: $(git show --oneline --no-patch ${GITHUB_SHA})" | tee -a $GITHUB_STEP_SUMMARY - - - name: Verify environment - id: verify-env - run: | - # Target branch must already exist - if ! git ls-remote --exit-code origin ${branch_name}; then - echo " Target branch must already exist" | tee -a $GITHUB_STEP_SUMMARY - exit 1 - fi - - # PR branch must *not* exist - if [ "${enable_force_push}" == "false" ]; then - if git ls-remote --exit-code origin ${pr_branch}; then - echo " PR branch cannot already exist - Delete branch and retry workflow or enable 'force'" | tee -a $GITHUB_STEP_SUMMARY - exit 1 - fi - fi - - if [[ ! $full_version =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - echo "Invalid version number: $full_version" - exit 1 - fi - - - name: Update version numbers in target branch - id: create-pr-branch - run: | - git checkout -b ${pr_branch} - echo "::group::Running update_version.sh" - ./ci/update_version.sh ${major_version} ${minor_version} ${patch_version} - echo "::endgroup::" - - if ! git diff --quiet; then - echo "::group::Diff" - git diff - echo "::endgroup::" - - git add . - - git config user.name github-actions - git config user.email github-actions@github.com - git commit -m "${pr_body}" - - # Push the changes to the release branch: - git push --force origin ${pr_branch} - fi - - - name: Create pull request for target branch - id: create-pr - run: | - gh pr create \ - -B "${branch_name}" \ - -b "${pr_body}" \ - -t "${pr_title}" \ - -H "${pr_branch}" diff --git a/CMakePresets.json b/CMakePresets.json index 68e4a089f6d..03bbef3c948 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -6,35 +6,6 @@ "patch": 0 }, "configurePresets": [ - { - "name": "install", - "displayName": "Install only (users and packagers)", - "generator": "Ninja", - "binaryDir": "${sourceDir}/build/install", - "cacheVariables": { - "CCCL_ENABLE_INSTALL_RULES": true, - "CCCL_ENABLE_LIBCUDACXX": true, - "libcudacxx_ENABLE_INSTALL_RULES": true, - "CCCL_ENABLE_CUB": true, - "CUB_ENABLE_INSTALL_RULES": true, - "CCCL_ENABLE_THRUST": true, - "THRUST_ENABLE_INSTALL_RULES": true, - "CCCL_ENABLE_UNSTABLE": false, - "CCCL_ENABLE_TESTING": false, - "CCCL_ENABLE_EXAMPLES": false, - "CCCL_ENABLE_BENCHMARKS": false, - "libcudacxx_ENABLE_CODEGEN": false, - "libcudacxx_ENABLE_CMAKE_TESTS": false, - "LIBCUDACXX_ENABLE_LIBCUDACXX_TESTS": false, - "CUB_ENABLE_HEADER_TESTING": false, - "CUB_ENABLE_TESTING": false, - "CUB_ENABLE_EXAMPLES": false, - "THRUST_ENABLE_HEADER_TESTING": false, - "THRUST_ENABLE_TESTING": false, - "THRUST_ENABLE_EXAMPLES": false, - "THRUST_ENABLE_BENCHMARKS": false - } - }, { "name": "base", "hidden": true, diff --git a/cccl-version.json b/cccl-version.json deleted file mode 100644 index 2886d290a88..00000000000 --- a/cccl-version.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "full": "2.6.0", - "major": 2, - "minor": 6, - "patch": 0 -} diff --git a/ci/update_version.sh b/ci/update_version.sh index 0da23540c92..9184b98e6a9 100755 --- a/ci/update_version.sh +++ b/ci/update_version.sh @@ -28,7 +28,6 @@ if [ -z "$major" ] || [ -z "$minor" ] || [ -z "$patch" ]; then fi # Version file paths -REPO_VERSION_FILE="cccl-version.json" CCCL_VERSION_FILE="libcudacxx/include/cuda/std/__cccl/version.h" THRUST_VERSION_FILE="thrust/thrust/version.h" CUB_VERSION_FILE="cub/cub/version.cuh" @@ -79,13 +78,7 @@ update_file () { fi } -# Update version information in files: - -update_file "$REPO_VERSION_FILE" "\"full\": \".+\"" " \"full\": \"$major.$minor.$patch\"" -update_file "$REPO_VERSION_FILE" "\"major\": .+," " \"major\": $major," -update_file "$REPO_VERSION_FILE" "\"minor\": .+," " \"minor\": $minor," -update_file "$REPO_VERSION_FILE" "\"patch\": .+" " \"patch\": $patch" - +# Update version information in files update_file "$CCCL_VERSION_FILE" "^#define CCCL_VERSION \([0-9]\+\)" "#define CCCL_VERSION $new_cccl_version" update_file "$THRUST_VERSION_FILE" "^#define THRUST_VERSION \([0-9]\+\)" "#define THRUST_VERSION $new_thrust_cub_version" update_file "$CUB_VERSION_FILE" "^#define CUB_VERSION \([0-9]\+\)" "#define CUB_VERSION $new_thrust_cub_version"