ci: auto-publish dev release to PyPI on every commit to main#58
Conversation
Adds .github/workflows/publish-dev.yml which, on every push to main, tags the commit as ``renderers-v<next-patch>.dev<commits-since-release>`` and publishes the resulting wheel to PyPI as a pre-release. Build runs from the freshly-created tag so hatch-vcs produces a clean PEP 440 version without the ``+gHASH`` local segment PyPI rejects. Mirrors the build/publish split from publish.yml so OIDC stays scoped to the publish job only. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ApprovabilityVerdict: Needs human review This PR adds automated publishing to PyPI on every main branch commit. Changes to production deployment automation that affect public package registries warrant human review to verify the versioning and publish configuration. You can customize Macroscope's approvability policy. Learn more. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 73aa68c. Configure here.
| if [ -z "$LATEST_RELEASE" ]; then | ||
| echo "No release tag matching 'renderers-v<MAJOR.MINOR.PATCH>' found" >&2 | ||
| exit 1 | ||
| fi |
There was a problem hiding this comment.
pipefail makes grep abort before empty-check runs
Medium Severity
When all renderers-v* tags are pre-release (or none exist), grep -Ev filters every line and exits with code 1. Because set -euo pipefail is active, the pipeline on lines 35–37 aborts the script immediately — the if [ -z "$LATEST_RELEASE" ] guard on line 38 is never reached, so the friendly error message is dead code. The job fails with a confusing, unexplained error instead. Appending || true to the pipeline (or wrapping the grep in { grep ... || true; }) would let the empty-check execute as intended.
Reviewed by Cursor Bugbot for commit 73aa68c. Configure here.


Summary
.github/workflows/publish-dev.ymlruns on every push tomain.renderers-v<next-patch>.dev<N>(whereN= commits since the latest non-prerelease tag) and publishes the wheel to PyPI as a pre-release.+gHASHlocal segment that PyPI rejects).publish.ymlso OIDC stays scoped to the publish job only.Notes
pypi-prodenvironment / trusted publisher. Confirm the PyPI Trusted Publisher allowspublish-dev.ymlas a workflow name — if it's pinned topublish.yml, the entry needs to be added.GITHUB_TOKEN, which deliberately does not re-triggerpublish.yml(avoids double-publish).git rev-list --count <release>..HEAD, so each main commit maps to a unique dev version even across reruns.Test plan
renderers-v0.1.8.devNtag appears and a matching pre-release version lands on PyPI.Nand publishes cleanly.publish.ymldoes not also fire from the auto-pushed tag.🤖 Generated with Claude Code
Note
Medium Risk
Automates tagging and publishing to the production PyPI project on every
mainpush; mis-tagging, trusted publisher config, or workflow bugs could create unintended public prereleases.Overview
Adds a new GitHub Actions workflow,
publish-dev.yml, that runs on every push tomainand automatically creates arenderers-v<next-patch>.dev<N>tag based on the latest non-prerelease release tag and commit count.The workflow then builds the wheel from that tag (to ensure a clean PEP 440 version) and publishes the resulting artifacts to PyPI using the existing
pypi-prodOIDC/trusted publisher setup, keeping the build→publish job split so only the publish job hasid-token: write.Reviewed by Cursor Bugbot for commit 73aa68c. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Auto-publish dev releases to PyPI on every commit to main
Adds a publish-dev.yml GitHub Actions workflow that runs on every push to main.
renderers-v<NEXT>.dev<N>) from the latest non-prerelease tag, bumping patch and using commit count since last release asN.uv build.pypa/gh-action-pypi-publish).cancel-in-progress: falseto avoid dropped publishes.Macroscope summarized 73aa68c.