Skip to content

Commit fce91e1

Browse files
add workflow tag job
1 parent 4e02bf5 commit fce91e1

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

.github/tag.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
next_version=v0.0."$(git tag --sort=-v:refname | head -n 1 | sed 's|.*\.||' | awk '{print $1 + 1}')"
3+
git tag $next_version
4+
gh release create $next_version

.github/workflows/go.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
pull_request:
1010
branches: [ "main" ]
1111

12+
permissions:
13+
contents: write
14+
1215
jobs:
1316

1417
build:
@@ -26,3 +29,15 @@ jobs:
2629

2730
- name: Test
2831
run: go test -v ./test/...
32+
33+
tag:
34+
runs-on: ubnutu-latest
35+
needs: [build]
36+
steps:
37+
- name: Checkout code
38+
uses: actions/checkout@v3
39+
40+
- name: Add tag & Release
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
run: bash .github/tag.sh

0 commit comments

Comments
 (0)