Skip to content

Commit c7d2017

Browse files
committed
refactor(workflows): derive docs CTK version from source
Remove the redundant release-time build-ctk-ver input and read the CTK build version from ci/versions.yml in the checked-out ref instead. Made-with: Cursor
1 parent 0a94b36 commit c7d2017

File tree

5 files changed

+11
-26
lines changed

5 files changed

+11
-26
lines changed

.github/RELEASE-core.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,6 @@ publish to PyPI.
136136
You can find it in the URL when viewing the run in the Actions tab
137137
(e.g. `https://github.com/NVIDIA/cuda-python/actions/runs/123456789`
138138
— the run ID is `123456789`).
139-
- **build-ctk-ver**: the `cuda.build.version` from
140-
[`ci/versions.yml`](../ci/versions.yml) (e.g. `13.1.1`)
141139
- **Which wheel index to publish to**: `testpypi`
142140

143141
2. Wait for the workflow to complete.

.github/workflows/build-docs.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ name: "CI: Build and update docs"
77
on:
88
workflow_call:
99
inputs:
10-
build-ctk-ver:
11-
type: string
12-
required: true
1310
component:
1411
description: "Component(s) to build docs for"
1512
required: false
@@ -47,18 +44,21 @@ jobs:
4744
run:
4845
shell: bash -el {0}
4946
steps:
50-
- name: validate build-ctk
51-
run: |
52-
if [ ! "${{ inputs.build-ctk-ver }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]; then
53-
echo "error: `build-ctk-ver` ${{ inputs.build-ctk-ver }} version does not match MAJOR.MINOR.MICRO" >&2
54-
exit 1
55-
fi
5647
- name: Checkout ${{ github.event.repository.name }}
5748
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5849
with:
5950
fetch-depth: 0
6051
ref: ${{ inputs.git-tag }}
6152

53+
- name: Read build CTK version
54+
run: |
55+
BUILD_CTK_VER=$(yq '.cuda.build.version' ci/versions.yml)
56+
if [[ ! "${BUILD_CTK_VER}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
57+
echo "error: derived CTK build version ${BUILD_CTK_VER} does not match MAJOR.MINOR.MICRO" >&2
58+
exit 1
59+
fi
60+
echo "BUILD_CTK_VER=${BUILD_CTK_VER}" >> "$GITHUB_ENV"
61+
6262
# TODO: This workflow runs on GH-hosted runner and cannot use the proxy cache
6363

6464
- name: Set up miniforge
@@ -82,7 +82,7 @@ jobs:
8282
uses: ./.github/actions/fetch_ctk
8383
with:
8484
host-platform: linux-64
85-
cuda-version: ${{ inputs.build-ctk-ver }}
85+
cuda-version: ${{ env.BUILD_CTK_VER }}
8686

8787
- name: Set environment variables
8888
run: |
@@ -103,7 +103,7 @@ jobs:
103103
echo "CUDA_CORE_ARTIFACT_BASENAME=${CUDA_CORE_ARTIFACT_BASENAME}" >> $GITHUB_ENV
104104
echo "CUDA_CORE_ARTIFACT_NAME=${CUDA_CORE_ARTIFACT_BASENAME}-${FILE_HASH}" >> $GITHUB_ENV
105105
echo "CUDA_CORE_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_core/dist")" >> $GITHUB_ENV
106-
CUDA_BINDINGS_ARTIFACT_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda${{ inputs.build-ctk-ver }}-linux-64"
106+
CUDA_BINDINGS_ARTIFACT_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda${BUILD_CTK_VER}-linux-64"
107107
echo "CUDA_BINDINGS_ARTIFACT_BASENAME=${CUDA_BINDINGS_ARTIFACT_BASENAME}" >> $GITHUB_ENV
108108
echo "CUDA_BINDINGS_ARTIFACT_NAME=${CUDA_BINDINGS_ARTIFACT_BASENAME}-${FILE_HASH}" >> $GITHUB_ENV
109109
echo "CUDA_BINDINGS_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_bindings/dist")" >> $GITHUB_ENV

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ jobs:
220220
secrets: inherit
221221
uses: ./.github/workflows/build-docs.yml
222222
with:
223-
build-ctk-ver: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
224223
is-release: ${{ github.ref_type == 'tag' }}
225224

226225
checks:

.github/workflows/release-cuda-pathfinder.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ jobs:
4040
tag: ${{ steps.vars.outputs.tag }}
4141
version: ${{ steps.vars.outputs.version }}
4242
run-id: ${{ steps.detect-run.outputs.run-id }}
43-
ctk-ver: ${{ steps.ctk.outputs.ctk-ver }}
4443
steps:
4544
- name: Verify running on default branch
4645
run: |
@@ -77,12 +76,6 @@ jobs:
7776
exit 1
7877
fi
7978
80-
- name: Read CTK build version
81-
id: ctk
82-
run: |
83-
ctk_ver=$(yq '.cuda.build.version' ci/versions.yml)
84-
echo "ctk-ver=${ctk_ver}" >> "$GITHUB_OUTPUT"
85-
8679
- name: Detect CI run ID
8780
id: detect-run
8881
env:
@@ -146,7 +139,6 @@ jobs:
146139
secrets: inherit
147140
uses: ./.github/workflows/build-docs.yml
148141
with:
149-
build-ctk-ver: ${{ needs.prepare.outputs.ctk-ver }}
150142
component: cuda-pathfinder
151143
git-tag: ${{ needs.prepare.outputs.tag }}
152144
run-id: ${{ needs.prepare.outputs.run-id }}

.github/workflows/release.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ on:
2828
required: false
2929
type: string
3030
default: ""
31-
build-ctk-ver:
32-
type: string
33-
required: true
3431
wheel-dst:
3532
description: "Which wheel index to publish to?"
3633
required: true
@@ -122,7 +119,6 @@ jobs:
122119
secrets: inherit
123120
uses: ./.github/workflows/build-docs.yml
124121
with:
125-
build-ctk-ver: ${{ inputs.build-ctk-ver }}
126122
component: ${{ inputs.component }}
127123
git-tag: ${{ inputs.git-tag }}
128124
run-id: ${{ needs.determine-run-id.outputs.run-id }}

0 commit comments

Comments
 (0)