File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77 - main
88 paths :
99 - VERSION
10-
10+
11+ permissions :
12+ contents : write
13+
1114jobs :
12- snapshot :
15+ release :
1316 runs-on : ubuntu-latest
1417
1518 steps :
2225 go-version-file : go.mod
2326 cache : true
2427
25- - uses : goreleaser/goreleaser-action@v6
26- with :
27- distribution : goreleaser
28- version : " ~> v2"
29- args : release --snapshot --clean
28+ - name : Read version
29+ id : version
30+ run : |
31+ VERSION=$(cat VERSION | tr -d '\r\n')
32+ echo "version=$VERSION" >> "$GITHUB_OUTPUT"
33+
34+ - name : Create tag
35+ run : |
36+ TAG="v${{ steps.version.outputs.version }}"
37+
38+ if git rev-parse "$TAG" >/dev/null 2>&1; then
39+ echo "Tag already exists"
40+ exit 0
41+ fi
42+
43+ git config user.name "github-actions[bot]"
44+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
45+
46+ git tag -a "$TAG" -m "Release $TAG"
47+ git push origin "$TAG"
48+
49+ - name : Run GoReleaser
50+ env :
51+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
52+ run : |
53+ git fetch --tags
54+ goreleaser release --clean
3055
You can’t perform that action at this time.
0 commit comments