Skip to content

Commit c01a428

Browse files
burrows99claude
andauthored
ci: auto-publish a GitHub Release on every merge to master (#4)
Each merge patch-bumps the version and cuts a release with auto-generated notes. Releases show up in followers' feeds and notify watchers — recurring, hands-off discoverability. Add "[skip release]" to a commit to skip one. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 2f85a3c commit c01a428

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Auto Release
2+
3+
# Every merge to master publishes a GitHub Release with auto-generated notes.
4+
# Releases surface in the feeds of people who follow you and notify everyone
5+
# watching the repo — the closest GitHub has to "posting" an update, and it
6+
# keeps the repo looking active for discovery. Include "[skip release]" in a
7+
# merge/commit message to skip a given release.
8+
on:
9+
push:
10+
branches: [master]
11+
12+
permissions:
13+
contents: write
14+
15+
concurrency:
16+
group: auto-release
17+
cancel-in-progress: false
18+
19+
jobs:
20+
release:
21+
if: "!contains(github.event.head_commit.message, '[skip release]')"
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0 # need full history + tags to compute the next version
27+
28+
- name: Compute next version (patch bump)
29+
id: ver
30+
run: |
31+
latest="$(git tag -l 'v[0-9]*.[0-9]*.[0-9]*' --sort=-v:refname | head -n1)"
32+
if [ -z "$latest" ]; then
33+
next="v0.1.0"
34+
else
35+
v="${latest#v}"
36+
major="${v%%.*}"; rest="${v#*.}"; minor="${rest%%.*}"; patch="${rest##*.}"
37+
next="v${major}.${minor}.$((patch + 1))"
38+
fi
39+
echo "tag=$next" >> "$GITHUB_OUTPUT"
40+
echo "Next release: $next (previous: ${latest:-none})"
41+
42+
- name: Publish release
43+
env:
44+
GH_TOKEN: ${{ github.token }}
45+
run: |
46+
gh release create "${{ steps.ver.outputs.tag }}" \
47+
--repo "${{ github.repository }}" \
48+
--target "${{ github.sha }}" \
49+
--title "${{ steps.ver.outputs.tag }}" \
50+
--generate-notes

0 commit comments

Comments
 (0)