Commit 43f2fcd
authored
fix(publish): create GitHub Release on tag push (#95)
Adds a GitHub Release creation step to the publish workflow so the
`v*` tag push that ships a PyPI release also produces a GitHub
Release page with the wheel + sdist attached. Closes the "manual
changelog duplication" gap that 0.16.3 would otherwise hit: the
land-badge on the landing page would render 0.16.3 only after a
separate `gh release create` step, which would race the PyPI publish
job in the same workflow run.
Diff:
- `permissions.contents: write` on the publish job — required by
softprops/action-gh-release to push the release ref. Additive to
the existing `id-token: write` (which PyPI Trusted Publishing
needs); does NOT weaken the existing security posture since the
workflow already has `actions/checkout@v4` writing into `${{
github.workspace }}`.
- New step "Create GitHub Release" at the end of the publish job,
gated on `startsWith(github.ref, 'refs/tags/v')` so manual
workflow_dispatch re-runs (used for hotfix rebuilds) don't create
duplicate releases on branch refs. `generate_release_notes: true`
asks GitHub to auto-aggregate merged PR titles + labels into the
release body so the GH release page mirrors CHANGELOG.md without
manual editing. `files: dist/*.whl, dist/*.tar.gz` attaches the
same artifacts that PyPI receives, so the release page doubles
as a download mirror for environments where pip isn't available.
Pinned to `softprops/action-gh-release@v2` (matches the project
release-train convention). The latest stable release is v3.0.2; the
inputs used here (`tag_name`, `generate_release_notes`, `files`) are
identical between v2 and v3, so bumping is a one-line change when
desired.
No changes to test/, build, or PyPI publish step. The existing
`needs: test` dependency still gates the release creation on a
green test matrix.1 parent 6c857b2 commit 43f2fcd
1 file changed
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
46 | 51 | | |
47 | 52 | | |
48 | 53 | | |
| |||
63 | 68 | | |
64 | 69 | | |
65 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
0 commit comments