4343 required : false
4444 default : " gh-pages"
4545 type : string
46+ bindings-package :
47+ description : " Resolved CUDA bindings package JSON"
48+ required : false
49+ default : " "
50+ type : string
4651
4752jobs :
4853 build :
@@ -62,31 +67,44 @@ jobs:
6267 uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
6368 with :
6469 fetch-depth : 1
65- ref : ${{ inputs.git-tag }}
70+ ref : ${{ inputs.is-release && format('refs/tags/{0}', inputs.git-tag) || inputs.git-tag }}
71+
72+ - name : Checkout docs control plane
73+ uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
74+ with :
75+ ref : ${{ github.sha }}
76+ path : .ci-control
77+
78+ - name : Install CI tool dependencies
79+ run : python3 -m pip install -e ./.ci-control/ci
6680
67- - name : Read build CTK version
81+ - name : Resolve CUDA bindings package
82+ env :
83+ BINDINGS_PACKAGE : ${{ inputs.bindings-package }}
84+ IS_RELEASE : ${{ inputs.is-release }}
85+ RELEASE_TAG : ${{ inputs.git-tag }}
6886 run : |
69- if [[ -f ci/versions.yml ]]; then
70- BUILD_CTK_VER=$(yq '.cuda.build.version' ci/versions.yml)
71- elif [[ -f ci/versions.json ]]; then
72- BUILD_CTK_VER=$(jq -r '.cuda.build.version' ci/versions.json)
87+ set -euo pipefail
88+ if [[ -n "$BINDINGS_PACKAGE" ]]; then
89+ resolved_bindings_package="$BINDINGS_PACKAGE"
90+ elif [[ "${IS_RELEASE}" == "true" ]]; then
91+ resolved_bindings_package=$(cd .ci-control && python3 -m ci.tools.bindings_config \
92+ --release-tag "$RELEASE_TAG" \
93+ --release-source-root ..)
7394 else
74- echo "error: cannot find ci/versions.yml or ci/versions.json" >&2
75- exit 1
76- fi
77- if [[ ! "${BUILD_CTK_VER}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
78- echo "error: derived CTK build version ${BUILD_CTK_VER} does not match MAJOR.MINOR.MICRO" >&2
79- exit 1
95+ resolved_bindings_package=$(cd .ci-control && python3 -m ci.tools.bindings_config \
96+ --release-status current)
8097 fi
81- echo "BUILD_CTK_VER=${BUILD_CTK_VER}" >> "$GITHUB_ENV"
98+ (cd .ci-control && python3 -m ci.tools.bindings_config \
99+ write-github-env "$GITHUB_ENV" <<< "$resolved_bindings_package")
82100
83101 # TODO: This workflow runs on GH-hosted runner and cannot use the proxy cache
84102
85103 - name : Set up miniforge
86104 uses : conda-incubator/setup-miniconda@be893c923ea9cf1cf7cd510fbdde27c7e18cbdcb # v4.1.0
87105 with :
88106 activate-environment : cuda-python-docs
89- environment-file : ./cuda_python/docs/environment-docs.yml
107+ environment-file : ./.ci-control/ cuda_python/docs/environment-docs.yml
90108 miniforge-version : latest
91109 conda-remove-defaults : " true"
92110 python-version : 3.12
@@ -106,13 +124,16 @@ jobs:
106124 cuda-version : ${{ env.BUILD_CTK_VER }}
107125
108126 - name : Set environment variables
127+ env :
128+ IS_RELEASE : ${{ inputs.is-release }}
129+ RELEASE_TAG : ${{ inputs.git-tag }}
109130 run : |
110131 PYTHON_VERSION_FORMATTED="312" # see above
111132 REPO_DIR=$(pwd)
112133
113- if [[ ${{ inputs.is-release }} == "true" ]]; then
134+ if [[ "$IS_RELEASE" == "true" ]]; then
114135 FILE_HASH="*"
115- DOCS_GITHUB_REF="${{ inputs.git-tag }} "
136+ DOCS_GITHUB_REF="$RELEASE_TAG "
116137 if [[ -z "${DOCS_GITHUB_REF}" ]]; then
117138 DOCS_GITHUB_REF="${GITHUB_REF_NAME}"
118139 fi
@@ -130,22 +151,27 @@ jobs:
130151 CUDA_BINDINGS_ARTIFACT_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda${BUILD_CTK_VER}-linux-64"
131152 echo "CUDA_BINDINGS_ARTIFACT_BASENAME=${CUDA_BINDINGS_ARTIFACT_BASENAME}" >> $GITHUB_ENV
132153 echo "CUDA_BINDINGS_ARTIFACT_NAME=${CUDA_BINDINGS_ARTIFACT_BASENAME}-${FILE_HASH}" >> $GITHUB_ENV
133- echo "CUDA_BINDINGS_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_bindings/dist")" >> $GITHUB_ENV
154+ echo "CUDA_BINDINGS_ARTIFACTS_DIR=$(realpath "$REPO_DIR/${BINDINGS_PACKAGE_ROOT}/dist")" >> $GITHUB_ENV
155+ CUDA_PYTHON_ARTIFACT_NAME="cuda-python-wheel-cuda${BUILD_CTK_VER}"
156+ echo "CUDA_PYTHON_ARTIFACT_NAME=${CUDA_PYTHON_ARTIFACT_NAME}" >> $GITHUB_ENV
134157
135158 - name : Download cuda-python build artifacts
159+ if : ${{ !inputs.is-release || inputs.component == 'all' || inputs.component == 'cuda-python' }}
136160 uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
137161 with :
138- name : cuda-python-wheel
162+ name : ${{ env.CUDA_PYTHON_ARTIFACT_NAME }}
139163 path : .
140164 run-id : ${{ inputs.run-id }}
141165 github-token : ${{ github.token }}
142166
143167 - name : Display structure of downloaded cuda-python artifacts
168+ if : ${{ !inputs.is-release || inputs.component == 'all' || inputs.component == 'cuda-python' }}
144169 run : |
145170 pwd
146171 ls -lahR .
147172
148173 - name : Download cuda-pathfinder build artifacts
174+ if : ${{ !inputs.is-release || inputs.component == 'all' || inputs.component == 'cuda-pathfinder' || inputs.component == 'cuda-core' }}
149175 uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
150176 with :
151177 name : cuda-pathfinder-wheel
@@ -154,6 +180,7 @@ jobs:
154180 github-token : ${{ github.token }}
155181
156182 - name : Display structure of downloaded cuda-pathfinder artifacts
183+ if : ${{ !inputs.is-release || inputs.component == 'all' || inputs.component == 'cuda-pathfinder' || inputs.component == 'cuda-core' }}
157184 run : |
158185 pwd
159186 ls -lahR cuda_pathfinder
@@ -166,7 +193,7 @@ jobs:
166193 path : ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}
167194
168195 - name : Download cuda.bindings build artifacts
169- if : ${{ inputs.is-release }}
196+ if : ${{ inputs.is-release && (inputs.component == 'all' || inputs.component == 'cuda-bindings' || inputs.component == 'cuda-core') }}
170197 uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
171198 with :
172199 pattern : ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }}
@@ -176,6 +203,7 @@ jobs:
176203 github-token : ${{ github.token }}
177204
178205 - name : Display structure of downloaded cuda.bindings artifacts
206+ if : ${{ !inputs.is-release || inputs.component == 'all' || inputs.component == 'cuda-bindings' || inputs.component == 'cuda-core' }}
179207 run : |
180208 pwd
181209 ls -lahR $CUDA_BINDINGS_ARTIFACTS_DIR
@@ -188,7 +216,7 @@ jobs:
188216 path : ${{ env.CUDA_CORE_ARTIFACTS_DIR }}
189217
190218 - name : Download cuda.core build artifacts
191- if : ${{ inputs.is-release }}
219+ if : ${{ inputs.is-release && (inputs.component == 'all' || inputs.component == 'cuda-core') }}
192220 uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
193221 with :
194222 pattern : ${{ env.CUDA_CORE_ARTIFACT_NAME }}
@@ -198,26 +226,37 @@ jobs:
198226 github-token : ${{ github.token }}
199227
200228 - name : Display structure of downloaded cuda.core build artifacts
229+ if : ${{ !inputs.is-release || inputs.component == 'all' || inputs.component == 'cuda-core' }}
201230 run : |
202231 pwd
203232 ls -lahR $CUDA_CORE_ARTIFACTS_DIR
204233
205- - name : Install all packages
234+ - name : Install cuda-pathfinder
235+ if : ${{ !inputs.is-release || inputs.component == 'all' || inputs.component == 'cuda-pathfinder' || inputs.component == 'cuda-core' }}
206236 run : |
207237 pushd cuda_pathfinder
208238 pip install *.whl
209239 popd
210240
241+ - name : Install cuda.bindings
242+ if : ${{ !inputs.is-release || inputs.component == 'all' || inputs.component == 'cuda-bindings' || inputs.component == 'cuda-core' }}
243+ run : |
211244 pushd "${CUDA_BINDINGS_ARTIFACTS_DIR}"
212245 pip install *.whl
213246 popd
214247
248+ - name : Install cuda.core
249+ if : ${{ !inputs.is-release || inputs.component == 'all' || inputs.component == 'cuda-core' }}
250+ run : |
215251 pushd "${CUDA_CORE_ARTIFACTS_DIR}"
216252 pip install *.whl
217253 popd
218254
219- # Subpackages are already installed from CI artifacts above.
220- # --no-deps avoids re-resolving cuda-core from PyPI during tag releases.
255+ - name : Install cuda-python
256+ if : ${{ !inputs.is-release || inputs.component == 'all' || inputs.component == 'cuda-python' }}
257+ run : |
258+ # Documentation builds do not exercise runtime dependencies.
259+ # --no-deps also avoids resolving artifacts absent from focused tag runs.
221260 pip install --no-deps cuda_python*.whl
222261
223262 # PR CI uses pull-request/<number> refs regardless of the target branch.
@@ -241,9 +280,11 @@ jobs:
241280
242281 - name : Build all docs
243282 if : ${{ inputs.component == 'all' }}
283+ env :
284+ IS_RELEASE : ${{ inputs.is-release }}
244285 run : |
245286 pushd cuda_python/docs/
246- if [[ "${{ inputs.is-release }} " == "false" ]]; then
287+ if [[ "$IS_RELEASE " == "false" ]]; then
247288 ./build_all_docs.sh latest-only
248289 else
249290 ./build_all_docs.sh
@@ -260,10 +301,20 @@ jobs:
260301
261302 - name : Build component docs
262303 if : ${{ inputs.component != 'all' }}
304+ env :
305+ DOCS_COMPONENT : ${{ inputs.component }}
306+ IS_RELEASE : ${{ inputs.is-release }}
263307 run : |
264- COMPONENT=$(echo "${{ inputs.component }}" | tr '-' '_')
265- pushd ${COMPONENT}/docs/
266- if [[ "${{ inputs.is-release }}" == "false" ]]; then
308+ case "$DOCS_COMPONENT" in
309+ cuda-bindings|cuda-core|cuda-pathfinder|cuda-python) ;;
310+ *) echo "error: unsupported docs component: $DOCS_COMPONENT" >&2; exit 1 ;;
311+ esac
312+ COMPONENT="${DOCS_COMPONENT//-/_}"
313+ if [[ "$DOCS_COMPONENT" == "cuda-bindings" ]]; then
314+ COMPONENT="${BINDINGS_PACKAGE_ROOT}"
315+ fi
316+ pushd "${COMPONENT}/docs/"
317+ if [[ "$IS_RELEASE" == "false" ]]; then
267318 ./build_docs.sh latest-only
268319 else
269320 ./build_docs.sh
@@ -276,13 +327,13 @@ jobs:
276327 fi
277328 ls -l build
278329 popd
279- if [[ "${{ inputs.component }} " != "cuda-python" ]]; then
280- TARGET="${{ inputs.component }} "
281- mkdir -p artifacts/docs/${TARGET}
330+ if [[ "$DOCS_COMPONENT " != "cuda-python" ]]; then
331+ TARGET="$DOCS_COMPONENT "
332+ mkdir -p " artifacts/docs/${TARGET}"
282333 else
283334 TARGET=""
284335 fi
285- mv ${COMPONENT}/docs/build/html/* artifacts/docs/${TARGET}
336+ mv " ${COMPONENT}" /docs/build/html/* " artifacts/docs/${TARGET}"
286337
287338 - name : Write rendered docs file list
288339 if : ${{ !inputs.is-release && startsWith(github.ref_name, 'pull-request/') }}
@@ -382,7 +433,7 @@ jobs:
382433 uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
383434 with :
384435 fetch-depth : 1
385- ref : ${{ inputs.git-tag }}
436+ ref : ${{ inputs.is-release && format('refs/tags/{0}', inputs.git-tag) || inputs. git-tag }}
386437
387438 - name : Download docs deployment payload
388439 uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
0 commit comments