Add PyPI publish workflow#93
Merged
Merged
Conversation
72e5865 to
5cc4714
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #93 +/- ##
=======================================
Coverage 95.82% 95.82%
=======================================
Files 142 142
Lines 14122 14122
=======================================
Hits 13533 13533
Misses 589 589 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Add a GitHub Action that builds an sdist and wheel on every push and uploads them to PyPI on tagged releases (modeled on the dags/optimagic setup, but using PyPI trusted publishing / OIDC instead of a stored API token). fetch-depth: 0 so hatch-vcs can derive the version from git tags. Add CHANGES.md to track releases. Releasing: bump by pushing a version tag (e.g. `v0.1.0`); the workflow's publish step is gated on `refs/tags`. Requires a trusted publisher to be configured for the skillmodels project on PyPI (repo OpenSourceEconomics/skillmodels, workflow publish-to-pypi.yml). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
5cc4714 to
3688047
Compare
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.
Adds release-to-PyPI automation, modeled on the
dags/optimagicworkflows but using PyPI Trusted Publishing (OIDC) instead of a stored API token.What this adds
.github/workflows/publish-to-pypi.yml— builds sdist + wheel on every push and publishes to PyPI on tagged releases (if: startsWith(github.ref, 'refs/tags')). Uses OIDC (permissions: id-token: write, nopassword:).fetch-depth: 0so hatch-vcs can read the version from git tags.CHANGES.md— release changelog.Already in place (no change needed)
hatchling+hatch-vcswithdynamic = ["version"](version from git tags).[project]metadata: description, README long-description, license, classifiers, keywords, authors/maintainers, URLs.LICENSEandREADME.md.Manual step required before the first publish
skillmodelsproject on PyPI (Project → Settings → Publishing): ownerOpenSourceEconomics, repositoryskillmodels, workflowpublish-to-pypi.yml, environment left blank. This is per-project — other OSE packages currently use API tokens, so there is nothing to inherit.To cut a release
git tag v0.1.0 && git push origin v0.1.0. The workflow builds and uploads automatically.🤖 Generated with Claude Code