Repository navigation
Publish to PyPI automatically when a version bump merges - #310
Merged
Merged
Conversation
Add a workflow that runs after Tests passes on a push to master. If drep/VERSION holds a version that isn't on PyPI yet, it builds the sdist and wheel, publishes them with PyPI trusted publishing, and tags a GitHub release whose notes are that version's CHANGELOG section. Merges that don't bump the version do nothing. It can also be run by hand. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013UpcPFwkh6QMusnD6ApThL
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds
.github/workflows/publish.yml, which publishes dRep to PyPI whenever a merged PR bumpsdrep/VERSION.master. A failing test run never publishes. It can also be run by hand from the Actions tab.drep/VERSIONand asks PyPI whether that version already exists. If it does, the workflow stops. So merges that don't bump the version do nothing.twine check, and uploads with PyPI trusted publishing. No API token is stored in the repo.vX.Y.Zand creates a GitHub release with the built files attached. The release notes are that version's section ofCHANGELOG.md.One-time setup needed before merging
On PyPI, go to drep → Manage → Publishing → Add a new publisher → GitHub. Enter owner
MrOlm, repositorydrep, workflowpublish.yml, environmentpypi. Until this is in place, the upload step will fail with an authentication error.Heads-up
PyPI's latest drep is 4.0.0; 4.0.1 was never uploaded.
masteris at 4.0.2, so the first run after this merges will publish 4.0.2 (which includes the 4.0.1 changes). 4.0.1 will be skipped on PyPI.Testing
actionlintpasses on both workflows.python -m buildproducesdrep-4.0.2.tar.gzanddrep-4.0.2-py3-none-any.whl, andtwine checkpasses. It warns that there's no long description; that was already the case.drep/4.0.0and 404 fordrep/4.0.2, as expected.master, so the first real run will happen after the merge.🤖 Generated with Claude Code
https://claude.ai/code/session_013UpcPFwkh6QMusnD6ApThL
Generated by Claude Code