-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Open
mnriem
wants to merge
13
commits into
main
Choose a base branch
from
mnriem/feat-2908-pypi-publishing
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+115
−13
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
a57743e
feat: add PyPI publishing workflow and readme metadata
mnriem 6fadb04
fix: address PR review feedback on publish workflow
mnriem fb6df4c
fix: use absolute URLs for README images (PyPI compatibility)
mnriem 6d15830
fix: address second review round
mnriem 1efe634
fix: address third review round
mnriem 465dacb
fix: add contents:read to build job, clarify manual publish
mnriem 5d7ab7d
fix: force tag resolution and validate before checkout
mnriem 121d434
fix: address review - links, install cmd, python pin
mnriem f61c0ce
fix: address review - python setup, docs alignment, publish flag
mnriem 1b9e9bb
fix: clarify PyPI availability timing in docs
mnriem 892ecea
fix: quote version specifier in release notes install command
mnriem 5f42723
fix: use specify-cli@latest consistently
mnriem 9da00e3
fix: pin release notes to exact version, clarify manual publish
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,79 @@ | ||
| 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 | ||
|
|
||
| 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 | ||
| with: | ||
| ref: refs/tags/${{ inputs.tag }} | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 | ||
|
|
||
| - 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@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | ||
| with: | ||
| name: dist | ||
| path: dist/ | ||
|
|
||
|
mnriem marked this conversation as resolved.
|
||
| 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@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 | ||
| with: | ||
| name: dist | ||
| path: dist/ | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 | ||
|
|
||
| - 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
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
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.