@@ -3,11 +3,11 @@ name: goreleaser
33on :
44 pull_request :
55 paths :
6- - .github/workflows/goreleaser.yml
7- - .goreleaser.yaml
6+ - .github/workflows/goreleaser.yml
7+ - .goreleaser.yaml
88 push :
99 tags :
10- - ' v* '
10+ - " v* "
1111
1212permissions :
1313 contents : write
@@ -16,56 +16,68 @@ jobs:
1616 goreleaser :
1717 runs-on : ubuntu-latest
1818 steps :
19- - name : Checkout
20- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2
21- with :
22- fetch-depth : 0
19+ - name : Free disk space
20+ uses : thiagokokada/free-disk-space@9a03d73a373bab1e204b8815f5c7752392482762
21+ with :
22+ # All of these do save some disk space, but are also somewhat slow to delete.
23+ # So we keep them to just speed up the workflow overall.
24+ android : false
25+ aws-cli : false
26+ debug : false
27+ docker-images : false
28+ google-cloud-sdk : false
29+ heroku : false
30+ llvm : false
31+ opt : false
32+ powershell : false
33+ python : false
34+ ruby : false
35+ rust : false
36+ tool-cache : false
37+ usrlocal : false
38+ usrmisc : false
39+ varcache : false
2340
24- - uses : actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # tag=v5.5.0
25- with :
26- go-version : v1.23.10
41+ - name : Checkout
42+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2
43+ with :
44+ fetch-depth : 0
2745
28- - name : Download go modules
29- run : |
30- echo "Downloading modules for go.mod"
31- go mod download
32- for gomod in **/go.mod; do
33- echo "Downloading modules for $gomod"
34- cd $(dirname $gomod)
35- go mod download
36- cd -
37- done
46+ - name : Setup Go
47+ - uses : actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # tag=v5.5.0
48+ with :
49+ go-version : v1.23.10
3850
39- - name : Delete non-semver tags
40- run : ' git tag -d $(git tag -l | grep -v "^v")'
51+ - name : Delete non-semver tags
52+ run : ' git tag -d $(git tag -l | grep -v "^v")'
4153
42- - name : Set LDFLAGS
43- run : echo LDFLAGS="$(make ldflags)" >> $GITHUB_ENV
54+ - name : Set LDFLAGS
55+ run : echo LDFLAGS="$(make ldflags)" >> $GITHUB_ENV
4456
45- - name : Run GoReleaser on tag
46- if : github.event_name != 'pull_request'
47- uses : goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # tag=v6.3.0
48- with :
49- distribution : goreleaser
50- version : latest
51- args : release --timeout 60m --parallelism 1 --fail-fast
52- env :
53- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
54- KREW_GITHUB_TOKEN : ${{ secrets.KREW_GITHUB_TOKEN }}
57+ - name : Run GoReleaser on tag
58+ if : github.event_name != 'pull_request'
59+ uses : goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # tag=v6.3.0
60+ with :
61+ distribution : goreleaser
62+ version : " ~> v2 "
63+ args : release --timeout 60m
64+ env :
65+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
66+ KREW_GITHUB_TOKEN : ${{ secrets.KREW_GITHUB_TOKEN }}
5567
56- - name : Run GoReleaser on pull request
57- if : github.event_name == 'pull_request'
58- uses : goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # tag=v6.3.0
59- with :
60- distribution : goreleaser
61- version : latest
62- args : release --timeout 60m --snapshot --parallelism 1 --fail-fast
63- env :
64- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
65- KREW_GITHUB_TOKEN : ${{ secrets.KREW_GITHUB_TOKEN }}
68+ - name : Run GoReleaser on pull request
69+ if : github.event_name == 'pull_request'
70+ uses : goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # tag=v6.3.0
71+ with :
72+ distribution : goreleaser
73+ version : " ~> v2 "
74+ args : release --timeout 60m --snapshot
75+ env :
76+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
77+ KREW_GITHUB_TOKEN : ${{ secrets.KREW_GITHUB_TOKEN }}
6678
67- - uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # tag=v4.6.2
68- if : ${{ always() }}
69- with :
70- name : binaries
71- path : dist/*.tar.gz
79+ - uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # tag=v4.6.2
80+ if : ${{ always() }}
81+ with :
82+ name : binaries
83+ path : dist/*.tar.gz
0 commit comments