add a release workflow - #214
Merged
Merged
Conversation
Pushing a release tag now builds the sdist, checks that it is complete and installable, drafts the GitHub release with it and uploads it to PyPI via trusted publishing.
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.
Releasing borgstore was fully manual so far:
python -m buildandtwine uploadon the maintainer machine, with a PyPI API token. This adds.github/workflows/release.yml, triggered by pushing a release tag, so that a release is just "update changes, merge, tag, push".The workflow has two jobs:
twine checks it, checks that the sdist really is the one for the pushed tag (a missing or unfetched tag would silently give a setuptools-scm dev version), installs it with all extras into a clean venv and runs the test suite against that installation, then drafts the GitHub release with the sdist attached. It is a draft because the release notes want a human; a re-run replaces the assets instead of failing.pypienvironment gate applies to the irreversible step alone.sdist only, as before.
No test services are set up for the sdist check: the sftp, s3 and rest backend tests skip themselves without
BORGSTORE_TEST_*_URL, the rclone tests skip without an rclone binary. What remains - posixfs, caching, hashing, nesting, threading - is what a sdist check needs.ci.ymlkeeps doing the full thing. The venv'sbingoes first onPATHthere, because the REST server tests spawnborgstore-server-restfromPATH.Actions are pinned to commit SHAs.
New
docs/development.rstdescribes the release procedure.One-time setup needed before the first release
borgstoreproject: ownerborgbackup, repositoryborgstore, workflowrelease.yml, environmentpypi.pypienvironment in the repository settings. Nothing in it is required, but configuring required reviewers makes the upload wait for an approval - the last chance to stop a release. "Prevent self-review" has to stay off for that to be approvable by the person who tagged.Testing
Verified locally against a clean clone at tag
0.6.1, with the Python version the workflow uses, by running the workflow's steps verbatim: build,twine check, install of the sdist with all extras into a fresh venv, 265 tests pass and 12 skip, without any test services. The version guard was checked both ways. The release-drafting shell logic was exercised withghstubbed: the create path, the--prereleasepath for ab1tag, and theupload --clobberre-run path. Docs build clean with-n -W.Not provable without a real tag: the artifact hand-off between the two jobs and the PyPI upload itself.