-
Notifications
You must be signed in to change notification settings - Fork 223
CI: Upload wheels to release artifacts and auto-create release drafts #873
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
43fde96
Initial plan
Copilot 724717e
Add shared script and update workflows to upload wheels to release ar…
Copilot 6e1c01d
Fix script argument validation and add comprehensive tests
Copilot 509d596
Auto-create release draft if none exists for given tag
Copilot da82dfe
Make run-id and component required inputs in release-upload workflow
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
leofang marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| # A utility script to download component wheels from GitHub Actions artifacts. | ||
| # This script reuses the same logic that was in release.yml to maintain consistency. | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| # Check required arguments | ||
| if [[ $# -lt 3 ]]; then | ||
| echo "Usage: $0 <run-id> <component> <repository> [output-dir]" >&2 | ||
| echo " run-id: The GitHub Actions run ID containing the artifacts" >&2 | ||
| echo " component: The component name pattern to download (e.g., cuda-core, cuda-bindings)" >&2 | ||
| echo " repository: The GitHub repository (e.g., NVIDIA/cuda-python)" >&2 | ||
| echo " output-dir: Optional output directory (default: ./dist)" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| RUN_ID="$1" | ||
| COMPONENT="$2" | ||
| REPOSITORY="$3" | ||
| OUTPUT_DIR="${4:-./dist}" | ||
|
|
||
| # Ensure we have a GitHub token | ||
| if [[ -z "${GH_TOKEN:-}" ]]; then | ||
| echo "Error: GH_TOKEN environment variable is required" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "Downloading wheels for component: $COMPONENT from run: $RUN_ID" | ||
|
|
||
| # Download component wheels using the same logic as release.yml | ||
| if [[ "$COMPONENT" == "all" ]]; then | ||
| # Download all component patterns | ||
| gh run download "$RUN_ID" -p "cuda-*" -R "$REPOSITORY" | ||
| else | ||
| gh run download "$RUN_ID" -p "${COMPONENT}*" -R "$REPOSITORY" | ||
| fi | ||
|
|
||
| # Create output directory | ||
| mkdir -p "$OUTPUT_DIR" | ||
|
|
||
| # Process downloaded artifacts | ||
| for p in cuda-* | ||
| do | ||
| if [[ ! -d "$p" ]]; then | ||
| continue | ||
| fi | ||
|
|
||
| # exclude cython test artifacts | ||
| if [[ "${p}" == *-tests ]]; then | ||
| echo "Skipping test artifact: $p" | ||
| continue | ||
| fi | ||
|
|
||
| # If we're not downloading "all", only process matching component | ||
| if [[ "$COMPONENT" != "all" && "$p" != ${COMPONENT}* ]]; then | ||
| continue | ||
| fi | ||
|
|
||
| echo "Processing artifact: $p" | ||
| # Move wheel files to output directory | ||
| if [[ -d "$p" ]]; then | ||
| find "$p" -name "*.whl" -exec mv {} "$OUTPUT_DIR/" \; | ||
| fi | ||
| done | ||
|
|
||
| # Clean up artifact directories | ||
| rm -rf cuda-* | ||
|
|
||
| echo "Downloaded wheels to: $OUTPUT_DIR" | ||
| ls -la "$OUTPUT_DIR" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.