Repository navigation
Publish releases to PyPI with Trusted Publishing - #36
Merged
Merged
Conversation
Add the Publish workflow used in urbansim and orca. On a published GitHub release it builds the sdist and wheel, runs twine check --strict, installs the wheel and runs the tests against it from outside the checkout (copying the tests and saved Overpass responses into the installed package), checks the version against the tag and the pre-release flag, and uploads through Trusted Publishing after approval in the pypi environment. workflow_dispatch builds and tests without publishing. CONTRIBUTING.md describes the automated release, with the manual upload as the fallback. Version 0.2.dev1.
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 automated publishing to PyPI through Trusted Publishing, using the same workflow as UrbanSim and Orca. Stacked on #35. It targets that branch for now and will be retargeted to
mainonce #35 merges..github/workflows/publish.yml(urbansim's, with osmnet names and the[test]extra)twine check --strict, installs the wheel, and runs the tests against it from outside the checkout. The tests and the saved Overpass responses are copied into the installed package; the live API tests are skipped.v0.2↔0.2), and checks that pre-release versions (rcN) go with pre-release GitHub releases and final versions with final ones.pypienvironment, which waits for approval from a required reviewer.id-token: writeis granted only to that job.skip-existinglets a re-run finish a partial upload.workflow_dispatchbuilds and tests without publishing. Merging tomainnever publishes.pypienvironment has required reviewers, and the trusted publisher (UDST/osmnet,publish.yml,pypi) is registered on PyPI.CONTRIBUTING.md: the PyPI section now describes the automated release, with the manualtwineupload as the fallback.Version
0.2.dev1, plus a changelog bullet.Verified locally: actionlint is clean, and the build and wheel-test step, run with the same commands, gives 47 passed and 3 skipped (live) from the installed wheel. After merging, a
workflow_dispatchdry run onmainwill exercise the build path, as with Orca; the release path (version check, approval, upload) is first exercised by0.2rc1.