Skip to content

Commit 6bc8dae

Browse files
committed
fea: add release pipeline
1 parent b31a236 commit 6bc8dae

1 file changed

Lines changed: 77 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Release Workflow
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
- "v*.*.*-*"
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
release:
14+
name: Create Release
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Get version
24+
id: get_version
25+
run: |
26+
VERSION=${GITHUB_REF#refs/tags/}
27+
echo "VERSION=$VERSION" >> $GITHUB_ENV
28+
echo "version=$VERSION" >> $GITHUB_OUTPUT
29+
30+
# Determine if this is a pre-release
31+
if [[ "$VERSION" == *-* ]]; then
32+
echo "prerelease=true" >> $GITHUB_OUTPUT
33+
else
34+
echo "prerelease=false" >> $GITHUB_OUTPUT
35+
fi
36+
37+
- name: Generate release notes
38+
run: |
39+
cat > release-notes.md << 'NOTES'
40+
## Release ${{ steps.get_version.outputs.version }}
41+
42+
### What's New
43+
44+
Check the [CHANGELOG](./CHANGELOG.md) for details.
45+
46+
### Installation
47+
48+
```bash
49+
# Clone and build
50+
git clone https://github.com/${{ github.repository }}.git
51+
cd webapp
52+
bun install
53+
bun run build
54+
```
55+
56+
### Verify
57+
58+
```bash
59+
bun run typecheck
60+
bun run lint
61+
bun test
62+
```
63+
64+
---
65+
66+
**Full Changelog**: https://github.com/${{ github.repository }}/compare/${{ steps.get_version.outputs.version }}...main
67+
NOTES
68+
69+
- name: Create GitHub Release
70+
uses: softprops/action-gh-release@v2
71+
with:
72+
name: Release ${{ steps.get_version.outputs.version }} 🎉
73+
body_path: release-notes.md
74+
draft: false
75+
prerelease: ${{ steps.get_version.outputs.prerelease }}
76+
env:
77+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)