Repository navigation
Automate releases: tag-derived version and a release per merge to main - #159
Conversation
The version now comes from the latest git tag (hatch-vcs) instead of a number in pyproject.toml. A new workflow tags and releases every merge to main: patch by default, with PR labels release:minor, release:major, release:draft, release:skip. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
No blocking findings. Added non-blocking comments on recovery after a tag push succeeds but release creation fails, and on loss of version provenance when installing GitHub source archives.
Reviewed the complete diff and relevant packaging, workflow, version-consumer, and contribution guidance. Static review only: I did not execute tests, builds, or workflows; the latest inspected checks show CPU CI in progress and GPU CI skipped. Postprocessing is not applicable to these release/packaging infrastructure changes.
|
|
||
| if [ -n "$(git tag --points-at "$GITHUB_SHA" --list 'v[0-9]*')" ]; then | ||
| echo "This commit is already tagged." | ||
| skip=true |
There was a problem hiding this comment.
Non-blocking: let a retry finish a partially created release. If git push origin "$TAG" succeeds but the subsequent gh release create fails, the retry fetches the tag, enters this branch, and reports success without ever creating the missing release. A manual dispatch at the same commit is also skipped. Consider checking for the release as well as the tag, reusing the existing tag to create a missing release, and making only a fully completed release a no-op. This keeps a transient API failure from requiring out-of-band repair.
| source = "vcs" | ||
|
|
||
| [tool.hatch.version.raw-options] | ||
| fallback_version = "0+unknown" |
There was a problem hiding this comment.
Non-blocking: preserve or document version provenance for release-archive installs. GitHub's generated source ZIP/tarball has no .git, and this repository supplies neither archive version metadata (.gitattributes only configures the notes merge driver) nor built wheel/sdist assets in the release workflow. Installing one of those source archives therefore falls back to 0+unknown, rather than retaining the release version as the previous static metadata did. This value also propagates through misc.get_version() into canonical_tags() and build_manifest(), so runs from different release archives lose that version identifier. Consider adding archive metadata, providing versioned build artifacts, or explicitly documenting that accurate version provenance requires a Git checkout or an override. The README's clone-based installation is not affected by this case.
…ion source archives Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
No material findings in the complete diff. The revision adds recovery for a pushed tag whose release is missing and Git archive metadata for version discovery, addressing the earlier non-blocking concerns at the code level. Checked the packaging, deployment/docs integration, version consumers, relevant tests, and repository guidance.
Static review only: I did not execute tests, builds, or workflows. The latest inspected checks show CPU CI in progress and GPU CI skipped; end-to-end release, Docker, Read the Docs, and archive-install behavior remain unverified here. Postprocessing is not applicable to these release/packaging infrastructure changes.
Summary
Cuts a release automatically on every merge to
main, with PR labels as the human decision about what kind of release it is.release:minor/release:majorrelease:draftrelease:skiprelease:draftcombines with the bump labels. The workflow can also be run by hand from the Actions tab (choose the bump and whether to draft), which covers a forgotten label.Changes
pyproject.tomlno longer carries a version number;hatch-vcsreads it from the latest tag. A tagged commit installs as0.4.1; later commits install as e.g.0.4.2.dev3+g<sha>. No more version-bump commits in PRs..github/workflows/release.yaml(new): on push tomain, looks up the merged PR's labels, computes the next tag from the latestvX.Y.Ztag, pushes it, and creates the GitHub release..github/release.yml(new): groups the generated notes by the existingenhancement,bug, anddocumentationlabels.deploy.yamlcomputes the version and passes it to the Dockerfile as a build argument.actions/checkoutis bumped from v2 to v4 there to fetch full history.Things to know
release:skip, so merging it does not cut a release. The next merged PR becomesv0.4.1.deployandreleasestart on the same push, so the image may be built before the new tag exists and report a dev version (0.4.1.dev1+g<sha>).pip install -e ., not the current checkout.mainwith no PR gets a patch release.Testing
hatch version(the commanddeploy.yamluses) prints only the version on stdout.main), the Docker build, and the Read the Docs build.🤖 Generated with Claude Code