Skip to content

Commit 028ab59

Browse files
authored
feat: add override env-var for setting custom artifact name (#528)
This is part of rapidsai/build-planning#270. I'm rolling out a new `rapids-artifact-name` tool to make our artifact names more consistent - part of the first phase of this is overriding the "default" names that get created by `shared-workflows`. I previously added the capability to override the artifact name from within the ci scripts for the stable ABI work, but that only covered the `python-build` workflows, this extends that capability to the `cpp-build` workflows. Tested this in rapidsai/rmm#2370 along with the vendored version of the script from rapidsai/gha-tools#253 Authors: - Gil Forsyth (https://github.com/gforsyth) Approvers: - Kyle Edwards (https://github.com/KyleFromNVIDIA) URL: #528
1 parent 65cb453 commit 028ab59

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

.github/workflows/conda-cpp-build.yaml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,18 +169,33 @@ jobs:
169169
# NEEDS alternative-gh-token-secret-name - API limits need to be for whatever token is used for upload/download. Repo token may be a different pool for rate limits.
170170
GH_TOKEN: ${{ inputs.alternative-gh-token-secret-name && secrets[inputs.alternative-gh-token-secret-name] || github.token }} # zizmor: ignore[overprovisioned-secrets]
171171
- name: C++ build
172+
id: cpp-build
172173
run: |
173174
ulimit -n "$(ulimit -Hn)"
174-
$INPUTS_SCRIPT
175+
# shellcheck disable=SC1090
176+
source "${INPUTS_SCRIPT}"
177+
178+
# Capture RAPIDS_PACKAGE_NAME if set by the build script
179+
if [[ -n "${RAPIDS_PACKAGE_NAME:-}" ]]; then
180+
echo "rapids-package-name=${RAPIDS_PACKAGE_NAME}" >> "${GITHUB_OUTPUT}"
181+
fi
175182
env:
176183
INPUTS_SCRIPT: "${{ inputs.script }}"
177184
STEP_NAME: "C++ build"
178185
# NEEDS alternative-gh-token-secret-name - may require a token with more permissions
179186
GH_TOKEN: ${{ inputs.alternative-gh-token-secret-name && secrets[inputs.alternative-gh-token-secret-name] || github.token }} # zizmor: ignore[overprovisioned-secrets]
180187
- name: Get Package Name and Location
181188
if: ${{ inputs.upload-artifacts }}
189+
env:
190+
# Pass RAPIDS_PACKAGE_NAME from cpp-build step if available
191+
RAPIDS_PACKAGE_NAME: ${{ steps.cpp-build.outputs.rapids-package-name }}
182192
run: |
183-
echo "RAPIDS_PACKAGE_NAME=$(RAPIDS_NO_PKG_EXTENSION=true rapids-package-name conda_cpp)" >> "${GITHUB_OUTPUT}"
193+
# Use RAPIDS_PACKAGE_NAME from build step if available, otherwise generate default
194+
if [[ -n "${RAPIDS_PACKAGE_NAME:-}" ]]; then
195+
echo "RAPIDS_PACKAGE_NAME=${RAPIDS_PACKAGE_NAME}" >> "${GITHUB_OUTPUT}"
196+
else
197+
echo "RAPIDS_PACKAGE_NAME=$(RAPISD_NO_PKG_EXTENSION=true rapids-package-name conda_cpp)" >> "${GITHUB_OUTPUT}"
198+
fi
184199
echo "CONDA_OUTPUT_DIR=${RAPIDS_CONDA_BLD_OUTPUT_DIR}" >> "${GITHUB_OUTPUT}"
185200
id: package-name
186201
- name: Show files to be uploaded

0 commit comments

Comments
 (0)