Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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:
Expand All @@ -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":"v","all":"v"}')[inputs.component] }}${{ inputs.version }}

defaults:
run:
shell: bash --noprofile --norc -xeuo pipefail {0}
Expand All @@ -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
Expand Down Expand Up @@ -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"
Expand All @@ -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:
Expand All @@ -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

Expand All @@ -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 }}

Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/tag-release.yml
Original file line number Diff line number Diff line change
@@ -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}"