Skip to content

Commit 642ea15

Browse files
authored
Merge pull request #127 from LuBingtan/dev
chore(workflow): add release workflow
2 parents a3c3b74 + 4651486 commit 642ea15

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

.github/workflows/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'VERSION'
9+
10+
jobs:
11+
release:
12+
name: Release
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
defaults:
17+
run:
18+
working-directory: ./src/github.com/${{ github.repository }}
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
22+
with:
23+
path: ./src/github.com/${{ github.repository }}
24+
- name: Create release
25+
id: create_release
26+
env:
27+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
run: |
29+
VERSION=$(cat VERSION | tr -d '\n')
30+
echo "VERSION=$VERSION" >> $GITHUB_ENV
31+
echo "Creating release $VERSION"
32+
gh release create "$VERSION" -R ${{ github.repository }} --title "$VERSION" --generate-notes

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v0.0.5

0 commit comments

Comments
 (0)