From 584853e55364f4153b9ac4dd87f5355ceabf508b Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 12 Feb 2026 11:57:14 -0500 Subject: [PATCH 1/2] Add a workflow to tag a release --- .github/workflows/release.yml | 25 ++++++++-------- .github/workflows/tag-release.yml | 47 +++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/tag-release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 68ce7c5716..af9a7e86e2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 @@ -19,8 +19,8 @@ on: - cuda-pathfinder - cuda-python - all - git-tag: - description: "The release git tag" + version: + description: "Version to release (e.g. 1.2.3)" required: true type: string run-id: @@ -39,6 +39,9 @@ on: - testpypi - pypi +env: + TAG: ${{ fromJSON('{"cuda_bindings":"v","cuda_core":"cuda-core-v","cuda_pathfinder":"cuda-pathfinder-v","cuda_python":"cuda-python-v","all":"all-v"}')[inputs.component] }}${{ inputs.version }} + defaults: run: shell: bash --noprofile --norc -xeuo pipefail {0} @@ -64,8 +67,8 @@ jobs: echo "Using provided run ID: ${{ inputs.run-id }}" echo "run-id=${{ inputs.run-id }}" >> $GITHUB_OUTPUT else - echo "Auto-detecting run ID for tag: ${{ inputs.git-tag }}" - RUN_ID=$(./ci/tools/lookup-run-id "${{ inputs.git-tag }}" "${{ github.repository }}") + echo "Auto-detecting run ID for tag: ${{ env.TAG }}" + RUN_ID=$(./ci/tools/lookup-run-id "${{ env.TAG }}" "${{ github.repository }}") echo "Auto-detected run ID: $RUN_ID" echo "run-id=$RUN_ID" >> $GITHUB_OUTPUT fi @@ -93,8 +96,8 @@ jobs: found=0 for idx in ${!tags[@]}; do - if [[ "${tags[$idx]}" == "${{ inputs.git-tag }}" ]]; then - echo "found existing release for ${{ inputs.git-tag }}" + if [[ "${tags[$idx]}" == "${{ env.TAG }}" ]]; then + echo "found existing release for ${{ env.TAG }}" found=1 if [[ "${is_draft[$idx]}" != "true" ]]; then echo "the release note is not in draft state" @@ -104,8 +107,8 @@ jobs: fi done if [[ "$found" == 0 ]]; then - echo "no release found for ${{ inputs.git-tag }}, creating draft release" - gh release create "${{ inputs.git-tag }}" --draft --repo "${{ github.repository }}" --title "Release ${{ inputs.git-tag }}" --notes "Release ${{ inputs.git-tag }}" + echo "no release found for ${{ env.TAG }}, creating draft release" + gh release create "${{ env.TAG }}" --draft --repo "${{ github.repository }}" --title "Release ${{ env.TAG }}" --notes "Release ${{ env.TAG }}" fi doc: @@ -124,7 +127,7 @@ jobs: with: build-ctk-ver: ${{ inputs.build-ctk-ver }} component: ${{ inputs.component }} - git-tag: ${{ inputs.git-tag }} + git-tag: ${{ vars.TAG }} run-id: ${{ needs.determine-run-id.outputs.run-id }} is-release: true @@ -139,7 +142,7 @@ jobs: secrets: inherit uses: ./.github/workflows/release-upload.yml with: - git-tag: ${{ inputs.git-tag }} + git-tag: ${{ vars.TAG }} run-id: ${{ needs.determine-run-id.outputs.run-id }} component: ${{ inputs.component }} diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml new file mode 100644 index 0000000000..0742349808 --- /dev/null +++ b/.github/workflows/tag-release.yml @@ -0,0 +1,47 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +name: Tag Release + +on: + workflow_dispatch: + inputs: + component: + description: "Component to tag (cuda_bindings implies cuda_python as well)" + required: true + type: choice + options: + - cuda_bindings + - cuda_core + - cuda_pathfinder + version: + description: "Version to tag (e.g. 1.2.3)" + required: true + type: string + +jobs: + tag-release: + runs-on: ubuntu-latest + permissions: + contents: write + env: + TAG: ${{ fromJSON('{"cuda_bindings":"v","cuda_core":"cuda-core-v","cuda_pathfinder":"cuda-pathfinder-v"}')[inputs.component] }}${{ inputs.version }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Configure git + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + + - name: Create empty commit and tag + run: | + git commit --allow-empty -m "Release ${TAG}" + git tag "${TAG}" + + - name: Push commit and tag + run: | + git push origin main + git push origin "${TAG}" From 4f9fd9bacc275999d0d7ce58e66d8a5f6b95eecf Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Thu, 12 Feb 2026 12:01:17 -0500 Subject: [PATCH 2/2] Fix mapping --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index af9a7e86e2..0274adb8c5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,7 +40,7 @@ on: - pypi env: - TAG: ${{ fromJSON('{"cuda_bindings":"v","cuda_core":"cuda-core-v","cuda_pathfinder":"cuda-pathfinder-v","cuda_python":"cuda-python-v","all":"all-v"}')[inputs.component] }}${{ inputs.version }} + TAG: ${{ fromJSON('{"cuda_bindings":"v","cuda_core":"cuda-core-v","cuda_pathfinder":"cuda-pathfinder-v","cuda_python":"v","all":"v"}')[inputs.component] }}${{ inputs.version }} defaults: run: