Skip to content

Commit 56fc804

Browse files
retlehsclaude
andauthored
👷 Add release workflow for tagging versions (#3286)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 56290f4 commit 56fc804

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version (e.g. 11.1.1)'
8+
required: true
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
release:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v6
18+
with:
19+
ref: main
20+
21+
- name: Validate version
22+
run: |
23+
if [[ ! "${{ github.event.inputs.version }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
24+
echo "❌ Invalid version format. Use semver (e.g. 11.1.1)"
25+
exit 1
26+
fi
27+
28+
- name: Check tag does not exist
29+
run: |
30+
if git ls-remote --tags origin "refs/tags/v${{ github.event.inputs.version }}" | grep -q .; then
31+
echo "❌ Tag v${{ github.event.inputs.version }} already exists"
32+
exit 1
33+
fi
34+
35+
- name: Update style.css version
36+
run: sed -i "s/Version: .*/Version: ${{ github.event.inputs.version }}/" style.css
37+
38+
- name: Create release commit and tag
39+
run: |
40+
git config user.name "github-actions[bot]"
41+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
42+
git add style.css
43+
git commit --message "🔖 v${{ github.event.inputs.version }}"
44+
git tag "v${{ github.event.inputs.version }}"
45+
git push origin "refs/tags/v${{ github.event.inputs.version }}"

0 commit comments

Comments
 (0)