Skip to content

Commit bd4c77b

Browse files
wrsmith108claude
andcommitted
feat: add semantic-release for automated versioning
- Replaces manual tag-based releases with conventional commits - Auto-generates CHANGELOG.md from commit messages - Auto-bumps version based on commit type (feat→minor, fix→patch) - Creates GitHub releases automatically on push to main Commit prefixes that trigger releases: - feat: → minor version bump (1.x.0) - fix: → patch version bump (1.0.x) - BREAKING CHANGE: → major version bump (x.0.0) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent b2dfe5b commit bd4c77b

File tree

4 files changed

+6786
-703
lines changed

4 files changed

+6786
-703
lines changed

.github/workflows/release.yml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,32 @@ name: Release
22

33
on:
44
push:
5-
tags:
6-
- 'v*'
5+
branches: [main]
76

87
permissions:
98
contents: write
9+
issues: write
10+
pull-requests: write
1011

1112
jobs:
1213
release:
1314
runs-on: ubuntu-latest
15+
# Skip if commit message contains [skip ci]
16+
if: "!contains(github.event.head_commit.message, '[skip ci]')"
1417
steps:
1518
- uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
persist-credentials: false
1622

17-
- name: Extract release notes
18-
id: notes
19-
run: |
20-
VERSION=${GITHUB_REF#refs/tags/v}
21-
# Extract section for this version from CHANGELOG.md
22-
awk "/^## \[${VERSION}\]/{flag=1; next} /^## \[/{flag=0} flag" CHANGELOG.md > notes.md
23-
# If no notes found, create a placeholder
24-
if [ ! -s notes.md ]; then
25-
echo "Release ${VERSION}" > notes.md
26-
fi
27-
28-
- name: Create Release
29-
uses: softprops/action-gh-release@v1
23+
- uses: actions/setup-node@v4
3024
with:
31-
body_path: notes.md
32-
generate_release_notes: false
25+
node-version: '20'
26+
cache: 'npm'
27+
28+
- run: npm ci
29+
30+
- name: Release
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
run: npx semantic-release

0 commit comments

Comments
 (0)