Commit 2a7a771
committed
ci(release): auto-create GitHub Release after PyPI publish
Adds a `create-release` job to `python-publish.yml` that runs after
`publish-to-pypi` succeeds and creates a GitHub Release with body
extracted from the corresponding CHANGELOG.md section.
Eliminates the manual `gh release create` step every release. Previously,
v0.4.0 → v0.4.1 each required a separate manual release-creation pass
after the tag-triggered PyPI publish.
Behavior:
- Triggered by tag push only (not manual workflow_dispatch republishes).
- Extracts the CHANGELOG section between `## [VERSION]` and the next
`## [` heading using a portable string-based awk script (no regex
escaping issues across awk variants).
- If no CHANGELOG entry is found for the version, falls back to a generic
"see commit history" body — does not fail the job.
- Title is the tag name (e.g. `v0.4.1`); the descriptive suffix on prior
releases ("v0.4.0 — Dynamic subject and action fields...") is convention,
not required, and the user can edit titles after the fact.
- `prerelease: ${{ contains(github.ref_name, '-') }}` flags any tag with
a hyphen (e.g. `v0.5.0-rc.1`) as prerelease automatically.
Pinned action SHAs:
- softprops/action-gh-release@b430933... (v3.0.0)
- actions/checkout@de0fac2... (v6, matches existing job)
Permissions:
- `contents: write` on this job only; default `contents: read` preserved
for the workflow-level minimum.
Tested locally:
- Successful extraction for v0.4.1 produces clean body (CHANGELOG section
without heading or next-version boundary).
- Missing version (e.g. v9.9.9) takes the fallback path without erroring.
This means future releases will be one-step: `git tag vX.Y.Z` + `git
push origin vX.Y.Z` and the workflow handles both PyPI publish and
GitHub Release creation.1 parent db0a064 commit 2a7a771
1 file changed
Lines changed: 43 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
0 commit comments