Skip to content

Commit 75b8a59

Browse files
releases works now!
1 parent 773a082 commit 75b8a59

1 file changed

Lines changed: 32 additions & 7 deletions

File tree

.github/workflows/release.yml

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ on:
77
- main
88
paths:
99
- VERSION
10-
10+
11+
permissions:
12+
contents: write
13+
1114
jobs:
12-
snapshot:
15+
release:
1316
runs-on: ubuntu-latest
1417

1518
steps:
@@ -22,9 +25,31 @@ jobs:
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

0 commit comments

Comments
 (0)