-
Notifications
You must be signed in to change notification settings - Fork 10.2k
feat: add PyPI publishing workflow and readme metadata #2915
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
+81
−0
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
7c510d0
feat: add PyPI publishing workflow and readme metadata
mnriem 8d4d975
fix: address PR review feedback on publish workflow
mnriem 8e1d9dd
fix: use absolute URLs for README images (PyPI compatibility)
mnriem bdefe46
fix: address second review round
mnriem fe39c6c
fix: address third review round
mnriem 25fa308
fix: add contents:read to build job, clarify manual publish
mnriem f49e9e6
fix: force tag resolution and validate before checkout
mnriem 00ee706
fix: address review - links, install cmd, python pin
mnriem 2e6a633
fix: address review - python setup, docs alignment, publish flag
mnriem 550045b
fix: clarify PyPI availability timing in docs
mnriem 9fd0fbc
fix: quote version specifier in release notes install command
mnriem 88e95b5
fix: use specify-cli@latest consistently
mnriem 85e29cb
fix: pin release notes to exact version, clarify manual publish
mnriem ca8240c
fix: keep source install as primary, PyPI as alternative
mnriem ef3f18f
fix: align checkout pin, soften PyPI wording, absolute links
mnriem 007a3fd
fix: align docs and release notes with pre-transfer state
mnriem d6460dd
fix: revert release notes to match main
mnriem 2fec9c4
fix: revert README and installation docs to match main
mnriem a931e7c
fix: fail fast if build produces no artifacts
mnriem 9eb1fd7
fix: align artifact action pins with repo lockfiles
mnriem 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,80 @@ | ||
| name: Publish to PyPI | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| tag: | ||
| description: 'Release tag to publish (e.g., v0.10.1)' | ||
| required: true | ||
| type: string | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
Copilot marked this conversation as resolved.
|
||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| actions: write | ||
|
Copilot marked this conversation as resolved.
|
||
| steps: | ||
| - name: Verify tag format | ||
| run: | | ||
| TAG="${{ inputs.tag }}" | ||
| if [[ ! "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | ||
| echo "Error: '$TAG' is not a valid release tag (expected vX.Y.Z)" | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Checkout release tag | ||
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| with: | ||
| ref: refs/tags/${{ inputs.tag }} | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 | ||
|
|
||
|
mnriem marked this conversation as resolved.
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 | ||
| with: | ||
| python-version: "3.13" | ||
|
|
||
| - name: Verify tag matches package version | ||
| run: | | ||
| TAG_VERSION="${{ inputs.tag }}" | ||
| TAG_VERSION="${TAG_VERSION#v}" | ||
| PROJECT_VERSION="$(python -c 'import tomllib; print(tomllib.load(open("pyproject.toml","rb"))["project"]["version"])')" | ||
| if [[ "$TAG_VERSION" != "$PROJECT_VERSION" ]]; then | ||
| echo "Error: Tag version ($TAG_VERSION) does not match pyproject.toml version ($PROJECT_VERSION)" | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Build package | ||
| run: uv build | ||
|
|
||
| - name: Upload build artifacts | ||
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | ||
| with: | ||
| name: dist | ||
| path: dist/ | ||
|
Copilot marked this conversation as resolved.
|
||
| if-no-files-found: error | ||
|
|
||
| publish: | ||
| needs: build | ||
| runs-on: ubuntu-latest | ||
| environment: pypi | ||
| permissions: | ||
| id-token: write | ||
|
Copilot marked this conversation as resolved.
|
||
| actions: read | ||
| steps: | ||
| - name: Download build artifacts | ||
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | ||
| with: | ||
| name: dist | ||
| path: dist/ | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 | ||
|
mnriem marked this conversation as resolved.
|
||
|
|
||
| - name: Publish to PyPI | ||
| run: uv publish | ||
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
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.