Commit 8aca5d4
committed
ci(publish): auto-create GitHub Release on tag push
The publish workflow already runs on tag push and ships to npm via
OIDC. Extend it so the same trigger creates / updates the
corresponding GitHub Release with notes pulled from CHANGELOG.md's
matching `## [VERSION]` section. This removes the manual
`gh release create ...` step from the release workflow and keeps
GitHub Releases in sync with what's on npm without separate ceremony.
Implementation:
- permissions.contents: read → write (needed to create the release).
- New step resolves the tag from github.ref / github.event.inputs.
- New step extracts the CHANGELOG section between `## [VERSION]` and
the next `## ` heading using awk with string-comparison
(`index($0, marker) == 1`) so brackets in the marker don't get
interpreted as a regex char class. Falls back to the tag's
annotation if the section can't be found.
- New step is idempotent: gh release edit if exists, gh release
create otherwise. --latest is set so the latest tag pushed becomes
the displayed Latest release on the repo's home page.
Verified locally that the extractor pulls the [0.2.2] section
verbatim. The next tag push (e.g. 0.2.3) will exercise the workflow
end-to-end.1 parent bfa050d commit 8aca5d4
1 file changed
Lines changed: 54 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
0 commit comments