@@ -2,40 +2,59 @@ name: Release
22on :
33 push :
44 branches :
5- - ' ** '
5+ - " ** "
66 pull_request :
77 branches :
8- - ' ** '
8+ - " ** "
99jobs :
1010 lint :
1111 runs-on : ubuntu-latest
1212 steps :
13- - uses : actions/checkout@v3
14- - uses : actions/setup-go@v3
13+ - uses : actions/checkout@v4
14+ - uses : actions/setup-go@v5
1515 with :
16- go-version : 1.23
17- - uses : golangci/golangci-lint-action@v3
16+ go-version : stable
17+ - uses : golangci/golangci-lint-action@v4
1818 test :
1919 runs-on : ubuntu-latest
2020 needs : lint
2121 steps :
22- - uses : actions/checkout@v3
23- - uses : actions/setup-go@v3
22+ - uses : actions/checkout@v4
23+ - uses : actions/setup-go@v5
2424 with :
25- go-version : 1.23
25+ go-version : stable
2626 - run : go test -v ./...
2727 release :
2828 runs-on : ubuntu-latest
2929 needs : test
3030 permissions :
3131 contents : write
3232 steps :
33- - uses : actions/checkout@v3
34- - uses : actions/setup-go@v3
33+ - uses : actions/checkout@v4
3534 with :
36- go-version : 1.23
37- - uses : go-semantic-release/action@v1
35+ fetch-depth : 0
36+ - uses : actions/setup-go@v5
3837 with :
39- hooks : goreleaser
38+ go-version : stable
39+ - name : Check new version using svu
40+ run : |
41+ go install github.com/caarlos0/svu/v3@latest
42+ NEXT_VERSION=$(svu next)
43+ CURRENT_VERSION=$(svu current)
44+ if [ "$NEXT_VERSION" == "$CURRENT_VERSION" ]; then
45+ exit 0
46+ fi
47+ git tag "$NEXT_VERSION"
48+ git push --tags
49+ - name : Run GoReleaser
50+ uses : goreleaser/goreleaser-action@v6
51+ with :
52+ # either 'goreleaser' (default) or 'goreleaser-pro'
53+ distribution : goreleaser
54+ # 'latest', 'nightly', or a semver
55+ version : " ~> v2"
56+ args : release --clean
4057 env :
41- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
58+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
59+ # Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
60+ # GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
0 commit comments