ci: replace release-PR workflow with canonical PSR push-to-main pattern#39
Merged
Conversation
Move from the sticky chore/release branch with hand-rolled tag-and-publish to the canonical python-semantic-release shape: one workflow on push to main that lets PSR own version, changelog, tag, GitHub Release, and asset upload in a single action. - Delete .github/workflows/release-pr.yml - Replace .github/workflows/release.yml with the PSR docs' canonical YAML (python-semantic-release@v10.5.3 + publish-action@v10.5.3, push: main trigger, concurrency group, contents: write only on the release job) - Add build_command = "uv build" so sdist and wheel attach to the GH Release via PSR's upload_to_vcs_release (default true) Source: https://python-semantic-release.readthedocs.io/en/stable/configuration/automatic-releases/github-actions.html
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.
Replace the two-workflow release-PR pattern with the canonical python-semantic-release shape: one workflow on
push: mainthat lets PSR own version, changelog, tag, GitHub Release, and asset upload in a single action.Why the current setup is fragile
chore/releasebranch and areleaselabel. PSR has no first-class support for release-PR semantics; the workflow is hand-rolled glue aroundsemantic-release version --no-push --no-tag --no-vcs-release --skip-build.grep -m1 '^version = 'inrelease.ymlafter merge, duplicating logic PSR already owns.CHANGELOG.md. The CHANGELOG is currently empty, so the awk script falls through to the "no entry matched" branch and produces effectively nothing.--no-vcs-release, then reimplemented by hand withgh release create. The most useful output PSR offers is the one being disabled.What this PR changes
.github/workflows/release-pr.yml.github/workflows/release.yml(87 lines → 37)build_command = "uv build"in[tool.semantic_release]The proposed
release.ymlis the canonical YAML from the python-semantic-release docs: push-to-main trigger, single release job withcontents: write,actions/checkout@v4+git reset --hard ${{ github.sha }}to release the exact triggering commit, thenpython-semantic-release@v10.5.3and (conditionally)publish-action@v10.5.3.build_command = "uv build"producessdistandwheel. PSR'supload_to_vcs_releasedefaults totrue, sodist/*attaches to the GH Release automatically.Local dry-run
Run from this branch with the branch matcher temporarily broadened to
.*for verification only; the merged config still pinsbranch = "main":v0.1.0is an annotated tag at the currentmainHEAD (2090678), so there are zero commits between the tag and HEAD. After this PR merges, the next conventional-commit landing onmainwill fire the first real release.Operator flow after merge
lint-pr-title.yml)ci.ymlgates correctnessmainrelease.ymlfires on the push: PSR bumpspyproject.toml, writesCHANGELOG.md, commits, tags, creates GH Release with auto-generated notes, builds and attachesdist/*No release PR, no second workflow, no awk.