-
Notifications
You must be signed in to change notification settings - Fork 0
ci: tag-based PyPI publishing via OIDC + GitHub Releases + docs #67
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
8 commits
Select commit
Hold shift + click to select a range
b713e50
ci: publish to PyPI via OIDC trusted publishing on v* tags
kdr 190a0eb
ci: create GitHub Release with sdist + wheel on each tag
kdr f315df9
docs: document the tag-based release flow in README
kdr 38c054f
ci: disable credential persistence on checkout
kdr 5b6e8e3
ci: add actions:read to publish and github-release jobs
kdr d25ca87
ci: declare explicit minimal permissions on build job
kdr d4f76ea
pr-review: reconcile release workflow after bot rounds
kdr 1c37a57
ci: drop skip-existing to keep a clear publish invariant
kdr 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| name: Publish to PyPI | ||
|
|
||
| # Publishes to PyPI via OIDC trusted publishing whenever a v* tag is pushed. | ||
| # No API tokens required — PyPI verifies the GitHub OIDC identity instead. | ||
| # | ||
| # git tag v0.7.16 # must match the version in pyproject.toml | ||
| # git push origin v0.7.16 | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - "v*" | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build distribution | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read # for checkout; upload-artifact uses the Actions runtime token, not GITHUB_TOKEN | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false # don't leave GITHUB_TOKEN in git config; build runs third-party code | ||
| # Submodule (spec/) is not needed — cloudglue/sdk is already committed. | ||
|
|
||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.12" | ||
|
|
||
| - name: Install build tooling | ||
| run: python -m pip install --upgrade build | ||
|
|
||
| - name: Verify tag matches pyproject version | ||
| run: | | ||
| PKG_VERSION="$(python -c 'import tomllib; print(tomllib.load(open("pyproject.toml","rb"))["project"]["version"])')" | ||
| TAG_VERSION="${GITHUB_REF_NAME#v}" | ||
| if [ "$PKG_VERSION" != "$TAG_VERSION" ]; then | ||
| echo "::error::Tag $GITHUB_REF_NAME (version $TAG_VERSION) does not match pyproject version $PKG_VERSION" | ||
| exit 1 | ||
| fi | ||
| echo "Building and publishing version $PKG_VERSION" | ||
|
|
||
| - name: Build sdist and wheel | ||
| run: python -m build | ||
|
|
||
| - name: Check artifacts | ||
| run: | | ||
| python -m pip install --upgrade twine | ||
| python -m twine check dist/* | ||
|
|
||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: dist | ||
| path: dist/ | ||
|
cursor[bot] marked this conversation as resolved.
|
||
|
|
||
| publish: | ||
| name: Publish to PyPI | ||
| needs: build | ||
| runs-on: ubuntu-latest | ||
| environment: | ||
| name: pypi | ||
| url: https://pypi.org/p/cloudglue | ||
| permissions: | ||
| id-token: write # required for OIDC trusted publishing | ||
| steps: | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| name: dist | ||
| path: dist/ | ||
|
cursor[bot] marked this conversation as resolved.
|
||
|
|
||
| - uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
|
||
| github-release: | ||
| name: Create GitHub Release | ||
| needs: publish # only release after a successful PyPI publish | ||
|
cursor[bot] marked this conversation as resolved.
|
||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write # required to create the release and upload assets | ||
| steps: | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| name: dist | ||
| path: dist/ | ||
|
|
||
| - name: Create release with sdist + wheel attached | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| files: dist/* | ||
| generate_release_notes: true | ||
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.