Repository navigation
feat(release): build and publish sdist/wheels on GitHub Release #1207
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 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
6fb4294
feat(release): build and publish sdist/wheels on GitHub Release
seonghobae 68e93b3
test(release): pin publish workflow trust boundaries
seonghobae 2c95af5
fix(release): harden package publish provenance
seonghobae 4b11bbd
docs(release): record hardened PyPI publishing
seonghobae 7507947
docs(release): terminate changelog fragment
seonghobae 3ad31e7
test(release): keep release assets immutable
seonghobae 0d9d327
fix(release): keep published assets immutable
seonghobae 25007d2
docs(release): record immutable release assets
seonghobae 3647e60
test(release): require explicit package dispatch
seonghobae 671b5de
fix(release): dispatch publish from immutable tag
seonghobae a10d3fa
fix(release): explicitly dispatch package publication
seonghobae 4ba34e9
docs(release): record explicit publish dispatch
seonghobae 29acb85
test(release): require wheels for supported Python
seonghobae 0fe0411
fix(release): build wheels for supported Python
seonghobae 64b06c8
test(release): decouple PyPI recovery from asset upload
seonghobae b51b88c
fix(release): decouple PyPI recovery from asset upload
seonghobae 32030e8
docs(release): record independent PyPI recovery
seonghobae 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
Some comments aren't visible on the classic Files Changed page.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| name: Publish Package | ||
|
|
||
| # Builds hash-pinnable sdist + wheel artifacts for a published GitHub Release | ||
| # and publishes them to PyPI. This exists so downstream consumers (e.g. | ||
| # LineageWeave) can depend on fast-mlsirm through a normal versioned PyPI | ||
| # requirement with uv/pip hash pinning instead of an unhashable git source. | ||
| # See https://github.com/ContextualWisdomLab/.github/issues/1212. | ||
|
|
||
| on: | ||
| release: | ||
| types: [published] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
seonghobae marked this conversation as resolved.
Resolved
|
||
|
|
||
| concurrency: | ||
| group: publish-pypi-${{ github.event.release.tag_name }} | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| sdist: | ||
| name: sdist | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 | ||
| - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 | ||
| with: | ||
| python-version: "3.12" | ||
| - name: Build sdist | ||
| uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b | ||
| with: | ||
| command: sdist | ||
| args: --out dist | ||
|
seonghobae marked this conversation as resolved.
Resolved
|
||
| - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a | ||
| with: | ||
| name: dist-sdist | ||
| path: dist | ||
|
|
||
| wheels: | ||
| name: wheels (${{ matrix.target }}) | ||
| runs-on: ${{ matrix.runner }} | ||
| timeout-minutes: 30 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - runner: ubuntu-latest | ||
| target: x86_64-unknown-linux-gnu | ||
| manylinux: "2014" | ||
| - runner: ubuntu-24.04-arm | ||
| target: aarch64-unknown-linux-gnu | ||
| manylinux: "2014" | ||
| - runner: macos-latest | ||
| target: universal2-apple-darwin | ||
| manylinux: "" | ||
| - runner: windows-latest | ||
| target: x86_64-pc-windows-msvc | ||
| manylinux: "" | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 | ||
| - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 | ||
| with: | ||
| python-version: "3.12" | ||
| - name: Build wheel | ||
| uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b | ||
| with: | ||
| target: ${{ matrix.target }} | ||
| manylinux: ${{ matrix.manylinux || 'auto' }} | ||
| args: --release --out dist | ||
| - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a | ||
| with: | ||
| name: dist-wheel-${{ matrix.target }} | ||
| path: dist | ||
|
|
||
| publish: | ||
| name: publish | ||
| needs: [sdist, wheels] | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| environment: pypi | ||
| steps: | ||
| - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c | ||
| with: | ||
| pattern: dist-* | ||
| path: dist | ||
| merge-multiple: true | ||
| - name: List built artifacts | ||
| run: ls -la dist | ||
| - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 | ||
| with: | ||
| python-version: "3.12" | ||
| - name: Install twine | ||
| run: python -m pip install --upgrade twine | ||
| - name: Verify distributions | ||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
| run: python -m twine check dist/* | ||
| - name: Attach release assets | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| run: gh release upload "${{ github.event.release.tag_name }}" dist/* --repo "${{ github.repository }}" --clobber | ||
|
github-actions[bot] marked this conversation as resolved.
Resolved
|
||
| - name: Publish to PyPI | ||
| env: | ||
| TWINE_USERNAME: ${{ secrets.PIPY_USERNAME }} | ||
| TWINE_PASSWORD: ${{ secrets.PIPY_TOKEN }} | ||
|
github-actions[bot] marked this conversation as resolved.
Resolved
|
||
| run: python -m twine upload --non-interactive dist/* | ||
|
github-actions[bot] marked this conversation as resolved.
Resolved
|
||
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.