77
88jobs :
99 goreleaser :
10- runs-on : ubuntu-20.04
10+ runs-on : ubuntu-latest
1111 steps :
12- - name : Checkout
13- uses : actions/checkout@v2
12+ - uses : actions/checkout@v3
1413 with :
1514 fetch-depth : 0
16- - name : Set up Go
17- uses : actions/setup-go@v2
15+ - run : git fetch --force --tags
16+ - uses : actions/setup-go@v3
1817 with :
19- go-version : 1.19
18+ go-version : ' >=1.19.5'
19+ cache : true
2020 - name : Set up Environment
2121 run : |
2222 echo "GOVERSION=$(go version|awk '{print $3}')" >> $GITHUB_ENV
@@ -26,13 +26,13 @@ jobs:
2626 sudo snap install --classic snapcraft
2727 mkdir -p $HOME/.cache/snapcraft/download
2828 mkdir -p $HOME/.cache/snapcraft/stage-packages
29- - name : Cache Go modules
30- 31- with :
32- path : ~/go/pkg/mod
33- key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
34- restore-keys : |
35- ${{ runner.os }}-go-
29+ # - name: Cache Go modules
30+ 31+ # with:
32+ # path: ~/go/pkg/mod
33+ # key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
34+ # restore-keys: |
35+ # ${{ runner.os }}-go-
3636 - name : Snapcraft Login
3737 if : success() && startsWith(github.ref, 'refs/tags/')
3838 env :
@@ -46,20 +46,13 @@ jobs:
4646 DOCKER_PASSWORD : ${{ secrets.DOCKER_PASS }}
4747 run : |
4848 echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin
49- - name : Install GoReleaser
50- uses : goreleaser/goreleaser-action@v2
49+ - uses : goreleaser/goreleaser-action@v4
5150 with :
52- install-only : true
53- - name : Run GoReleaser
51+ distribution : goreleaser
52+ version : latest
53+ args : release --rm-dist
5454 env :
5555 GITHUB_TOKEN : ${{ secrets.PUBLISH_TOKEN }}
56- run : |
57- if [[ $GITHUB_REF == refs/tags/* ]]
58- then
59- goreleaser release --rm-dist
60- else
61- goreleaser release --rm-dist --snapshot
62- fi
6356 - name : Clear
6457 if : always()
6558 run : rm -f ${HOME}/.docker/config.json
0 commit comments