-
Notifications
You must be signed in to change notification settings - Fork 8
Ship native XDR wheels and tag-driven Python releases #51
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
11 commits
Select commit
Hold shift + click to select a range
61c421b
Initialize the shared XDR I/O pool only once
tpn 3c61594
Build Linux wheels with native XDR and private CFITSIO
tpn dc52357
Validate and publish the native wheel matrix in CI
tpn cffcf42
Derive package versions from release tags
tpn 712e76d
Build and publish tag releases and release candidates
tpn d5c1db1
Clarify installation before the first PyPI release
tpn 263eeab
Clarify replacing a waiting publication run
tpn fd2a985
Keep release tooling caches local to each job
tpn 46ea6f1
Add MPI and Dragon installation extras
tpn a0cfa9c
Exercise installed wheels with real compute runtimes
tpn 90c2259
Require explicit PyPI promotion and document install changes
tpn 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,152 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| name: publish | ||
|
|
||
| on: | ||
| push: | ||
| tags: ["v*"] | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: Existing release tag version, such as 0.1.3rc0 | ||
| required: true | ||
| type: string | ||
| target: | ||
| description: Protected publishing environment | ||
| required: true | ||
| type: choice | ||
| options: [testpypi, pypi] | ||
| default: testpypi | ||
| run-id: | ||
| description: Reuse this release build run instead of rebuilding (optional) | ||
| required: false | ||
| type: string | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: publish-${{ inputs.target || 'testpypi' }}-${{ github.event_name == 'push' && github.ref_name || format('v{0}', inputs.version) }} | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| prepare: | ||
| if: >- | ||
| (github.event_name == 'push' && !github.event.deleted) || | ||
| (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 5 | ||
| outputs: | ||
| version: ${{ steps.release.outputs.version }} | ||
| sha: ${{ steps.release.outputs.sha }} | ||
| tag: ${{ steps.release.outputs.tag }} | ||
| target: ${{ inputs.target || 'testpypi' }} | ||
| steps: | ||
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 | ||
| with: | ||
| persist-credentials: false | ||
| fetch-depth: 0 | ||
| - name: Resolve the release tag to a reviewed source commit | ||
| id: release | ||
| env: | ||
| RELEASE_TAG: ${{ github.event_name == 'push' && github.ref_name || format('v{0}', inputs.version) }} | ||
| EXPECTED_SHA: ${{ github.event_name == 'push' && github.sha || '' }} | ||
| BUILD_RUN_ID: ${{ inputs.run-id }} | ||
| run: | | ||
| if test -n "$BUILD_RUN_ID"; then | ||
| [[ "$BUILD_RUN_ID" =~ ^[1-9][0-9]*$ ]] | ||
| fi | ||
| python scripts/wheels/release.py resolve "$RELEASE_TAG" --expected-sha "$EXPECTED_SHA" | ||
|
|
||
| build: | ||
| name: release wheels | ||
| needs: prepare | ||
| if: inputs.run-id == '' | ||
| uses: ./.github/workflows/wheels.yml | ||
| with: | ||
| source-ref: ${{ needs.prepare.outputs.sha }} | ||
| release-version: ${{ needs.prepare.outputs.version }} | ||
|
|
||
| stage: | ||
| needs: [prepare, build] | ||
| if: >- | ||
| !cancelled() && needs.prepare.result == 'success' && | ||
| (needs.build.result == 'success' || | ||
| (needs.build.result == 'skipped' && inputs.run-id != '')) | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 10 | ||
| permissions: | ||
| actions: read | ||
| contents: read | ||
| outputs: | ||
| pending: ${{ steps.upload.outputs.pending }} | ||
| steps: | ||
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 | ||
| with: | ||
| persist-credentials: false | ||
| fetch-depth: 0 | ||
| - uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6 | ||
| with: | ||
| version: "0.12.1" | ||
| enable-cache: false | ||
| - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | ||
| with: | ||
| name: cuphoton-distributions | ||
| path: dist | ||
| run-id: ${{ inputs.run-id || github.run_id }} | ||
| github-token: ${{ github.token }} | ||
| - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | ||
| with: | ||
| name: cuphoton-build-provenance | ||
| path: provenance | ||
| run-id: ${{ inputs.run-id || github.run_id }} | ||
| github-token: ${{ github.token }} | ||
| - name: Verify the build, tag, complete matrix, and unchanged bytes | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| BUILD_RUN_ID: ${{ inputs.run-id || github.run_id }} | ||
| RELEASE_TAG: ${{ needs.prepare.outputs.tag }} | ||
| RELEASE_VERSION: ${{ needs.prepare.outputs.version }} | ||
| SOURCE_SHA: ${{ needs.prepare.outputs.sha }} | ||
| run: | | ||
| python scripts/wheels/release.py resolve "$RELEASE_TAG" --expected-sha "$SOURCE_SHA" | ||
| python scripts/wheels/check_distributions.py dist --version "$RELEASE_VERSION" | ||
| python scripts/wheels/release.py verify dist provenance/provenance.json \ | ||
| --tag "$RELEASE_TAG" --sha "$SOURCE_SHA" --run-id "$BUILD_RUN_ID" | ||
| uvx --isolated --from twine==6.2.0 twine check --strict dist/* | ||
| cat provenance/provenance.json >> "$GITHUB_STEP_SUMMARY" | ||
| - name: Exclude already published files only when their hashes match | ||
| id: upload | ||
| env: | ||
| RELEASE_VERSION: ${{ needs.prepare.outputs.version }} | ||
| TARGET: ${{ needs.prepare.outputs.target }} | ||
| run: | | ||
| python scripts/wheels/release.py pending dist --version "$RELEASE_VERSION" --target "$TARGET" | ||
| - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | ||
| if: steps.upload.outputs.pending != '0' | ||
| with: | ||
| name: publish-distributions | ||
| path: dist/* | ||
| if-no-files-found: error | ||
|
|
||
| publish: | ||
| needs: [prepare, stage] | ||
| if: >- | ||
| !cancelled() && needs.prepare.result == 'success' && | ||
| needs.stage.result == 'success' && needs.stage.outputs.pending != '0' | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 10 | ||
| environment: | ||
| name: ${{ needs.prepare.outputs.target }} | ||
| permissions: | ||
| id-token: write | ||
| steps: | ||
| - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | ||
| with: | ||
| name: publish-distributions | ||
| path: dist | ||
| - uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # release/v1 | ||
| with: | ||
| repository-url: ${{ needs.prepare.outputs.target == 'testpypi' && 'https://test.pypi.org/legacy/' || 'https://upload.pypi.org/legacy/' }} | ||
Oops, something went wrong.
Oops, something went wrong.
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.