Skip to content

Commit d12a831

Browse files
committed
ci: build release artifacts in release workflows
Move release publishing away from tag-triggered CI artifact lookup by having release workflows verify main CI, build tagged artifacts in-run, and publish from those exact outputs. This cuts duplicate release work and keeps the release docs, assets, and wheel uploads tied to the same workflow execution. Made-with: Cursor
1 parent 38ec15d commit d12a831

10 files changed

Lines changed: 454 additions & 309 deletions

File tree

.github/ISSUE_TEMPLATE/release_checklist.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ body:
2323
- label: "Finalize the doc update, including release notes (\"Note: Touching docstrings/type annotations in code is OK during code freeze, apply your best judgement!\")"
2424
- label: Update the docs for the new version
2525
- label: Create a public release tag
26-
- label: Wait for the tag-triggered CI run to complete, and use that run ID for release workflows
26+
- label: Confirm the tagged commit already has a green CI run on main, then run the release workflow for that tag
2727
- label: If any code change happens, rebuild the wheels from the new tag
2828
- label: Upload wheels to PyPI
2929
- label: Update the conda recipe & release conda packages

.github/RELEASE-core.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,14 @@ git push origin cuda-core-v0.6.0
108108

109109
---
110110

111-
## Wait for the tag-triggered CI run to complete
111+
## Verify the tagged commit already passed CI on `main`
112112

113-
Pushing the tag triggers a CI run automatically. Monitor it in the
114-
**Actions** tab on GitHub.
113+
Before running release, confirm that the tagged commit already has a
114+
successful `CI` run on `main`. The release workflow now checks this as a
115+
preflight step, but it is still worth verifying up front.
115116

116-
- **All CI tests should succeed.** If any fail, investigate and rerun as
117-
needed.
118-
- Note the **run ID** of the successful tag-triggered run. The release
119-
workflow can auto-detect it from the tag, but you can also provide it
120-
explicitly.
117+
- **All CI tests on `main` should already be green.** If any fail, fix them
118+
before tagging or release will be blocked.
121119

122120
---
123121

@@ -129,9 +127,8 @@ publish to TestPyPI, then publish the same wheel set to PyPI.
129127
1. Go to **Actions > CI: Release** and run the workflow with:
130128
- **Component**: `cuda-core`
131129
- **The release git tag**: `cuda-core-v0.6.0`
132-
133-
The workflow automatically looks up the successful tag-triggered CI run
134-
for the selected release tag.
130+
The workflow builds the release artifacts directly from the selected tag
131+
after verifying that the tagged commit already passed `CI` on `main`.
135132

136133
2. Wait for the workflow to complete. It will:
137134
- publish the selected wheels to TestPyPI

.github/workflows/build-docs.yml

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ on:
2424
default: ""
2525
type: string
2626
run-id:
27-
description: "The GHA run ID that generated validated artifacts"
27+
description: "The workflow run ID that produced the artifacts to document"
2828
required: false
2929
default: ${{ github.run_id }}
3030
type: string
@@ -109,6 +109,7 @@ jobs:
109109
echo "CUDA_BINDINGS_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_bindings/dist")" >> $GITHUB_ENV
110110
111111
- name: Download cuda-python build artifacts
112+
if: ${{ !inputs.is-release || inputs.component == 'all' || inputs.component == 'cuda-python' }}
112113
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
113114
with:
114115
name: cuda-python-wheel
@@ -117,11 +118,13 @@ jobs:
117118
github-token: ${{ github.token }}
118119

119120
- name: Display structure of downloaded cuda-python artifacts
121+
if: ${{ !inputs.is-release || inputs.component == 'all' || inputs.component == 'cuda-python' }}
120122
run: |
121123
pwd
122124
ls -lahR .
123125
124126
- name: Download cuda-pathfinder build artifacts
127+
if: ${{ !inputs.is-release || inputs.component == 'all' || inputs.component == 'cuda-pathfinder' || inputs.component == 'cuda-core' || inputs.component == 'cuda-python' }}
125128
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
126129
with:
127130
name: cuda-pathfinder-wheel
@@ -130,19 +133,20 @@ jobs:
130133
github-token: ${{ github.token }}
131134

132135
- name: Display structure of downloaded cuda-pathfinder artifacts
136+
if: ${{ !inputs.is-release || inputs.component == 'all' || inputs.component == 'cuda-pathfinder' || inputs.component == 'cuda-core' || inputs.component == 'cuda-python' }}
133137
run: |
134138
pwd
135139
ls -lahR cuda_pathfinder
136140
137141
- name: Download cuda.bindings build artifacts
138-
if: ${{ !inputs.is-release }}
142+
if: ${{ !inputs.is-release && (inputs.component == 'all' || inputs.component == 'cuda-bindings' || inputs.component == 'cuda-core' || inputs.component == 'cuda-python') }}
139143
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
140144
with:
141145
name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }}
142146
path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}
143147

144148
- name: Download cuda.bindings build artifacts
145-
if: ${{ inputs.is-release }}
149+
if: ${{ inputs.is-release && (inputs.component == 'all' || inputs.component == 'cuda-bindings' || inputs.component == 'cuda-core' || inputs.component == 'cuda-python') }}
146150
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
147151
with:
148152
pattern: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }}
@@ -152,19 +156,20 @@ jobs:
152156
github-token: ${{ github.token }}
153157

154158
- name: Display structure of downloaded cuda.bindings artifacts
159+
if: ${{ !inputs.is-release || inputs.component == 'all' || inputs.component == 'cuda-bindings' || inputs.component == 'cuda-core' || inputs.component == 'cuda-python' }}
155160
run: |
156161
pwd
157162
ls -lahR $CUDA_BINDINGS_ARTIFACTS_DIR
158163
159164
- name: Download cuda.core build artifacts
160-
if: ${{ !inputs.is-release }}
165+
if: ${{ !inputs.is-release && (inputs.component == 'all' || inputs.component == 'cuda-core') }}
161166
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
162167
with:
163168
name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}
164169
path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }}
165170

166171
- name: Download cuda.core build artifacts
167-
if: ${{ inputs.is-release }}
172+
if: ${{ inputs.is-release && (inputs.component == 'all' || inputs.component == 'cuda-core') }}
168173
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
169174
with:
170175
pattern: ${{ env.CUDA_CORE_ARTIFACT_NAME }}
@@ -174,25 +179,38 @@ jobs:
174179
github-token: ${{ github.token }}
175180

176181
- name: Display structure of downloaded cuda.core build artifacts
182+
if: ${{ !inputs.is-release || inputs.component == 'all' || inputs.component == 'cuda-core' }}
177183
run: |
178184
pwd
179185
ls -lahR $CUDA_CORE_ARTIFACTS_DIR
180186
181-
- name: Install all packages
187+
- name: Install documentation packages
182188
run: |
183-
pushd cuda_pathfinder
184-
pip install *.whl
185-
popd
189+
shopt -s nullglob
186190
187-
pushd "${CUDA_BINDINGS_ARTIFACTS_DIR}"
188-
pip install *.whl
189-
popd
191+
pathfinder_wheels=(cuda_pathfinder/*.whl)
192+
if (( ${#pathfinder_wheels[@]} > 0 )); then
193+
pip install "${pathfinder_wheels[@]}"
194+
elif [[ "${{ inputs.is-release }}" == "true" && "${{ inputs.component }}" == "all" ]]; then
195+
pip install cuda-pathfinder
196+
fi
190197
191-
pushd "${CUDA_CORE_ARTIFACTS_DIR}"
192-
pip install *.whl
193-
popd
198+
bindings_wheels=("${CUDA_BINDINGS_ARTIFACTS_DIR}"/*.whl)
199+
if (( ${#bindings_wheels[@]} > 0 )); then
200+
pip install "${bindings_wheels[@]}"
201+
fi
194202
195-
pip install cuda_python*.whl
203+
core_wheels=("${CUDA_CORE_ARTIFACTS_DIR}"/*.whl)
204+
if (( ${#core_wheels[@]} > 0 )); then
205+
pip install "${core_wheels[@]}"
206+
elif [[ "${{ inputs.is-release }}" == "true" && "${{ inputs.component }}" == "all" ]]; then
207+
pip install cuda-core
208+
fi
209+
210+
python_wheels=(cuda_python*.whl)
211+
if (( ${#python_wheels[@]} > 0 )); then
212+
pip install "${python_wheels[@]}"
213+
fi
196214
197215
# This step sets the PR_NUMBER/BUILD_LATEST/BUILD_PREVIEW env vars.
198216
- name: Get PR number

0 commit comments

Comments
 (0)