Skip to content

Commit 87a646a

Browse files
committed
- [!] fix CI build
1 parent b771b66 commit 87a646a

File tree

1 file changed

+22
-17
lines changed

1 file changed

+22
-17
lines changed

.github/workflows/go-release-build.yml

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,59 @@
11
name: build
22

33
env:
4-
GO111MODULE: off
4+
#GO111MODULE: off
55

66
on:
77
push:
88
branches:
99
- 'master'
1010
tags:
1111
- 'v*'
12-
12+
pull_request:
1313
# Allows you to run this workflow manually from the Actions tab
1414
workflow_dispatch:
1515

1616
jobs:
1717
build:
1818
runs-on: ubuntu-latest
1919
steps:
20+
-
21+
name: Checkout
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
2025
-
2126
name: Set up Go
22-
uses: actions/setup-go@v2
27+
uses: actions/setup-go@v5
2328
with:
24-
go-version: 1.17
29+
go-version: 1.23.1
2530

2631
-
27-
name: Checkout
28-
uses: actions/checkout@v2
32+
name: Cache Go modules
33+
uses: actions/cache@v4
34+
# Do before go get
2935
with:
30-
fetch-depth: 0
36+
path: ~/go/pkg/mod
37+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
38+
restore-keys: |
39+
${{ runner.os }}-go-
3140
3241
-
3342
name: Tests
3443
run: |
35-
export GOPATH=/home/runner/go
36-
mkdir -vp $GOPATH/src/github.com/$GITHUB_REPOSITORY
37-
rmdir -v $GOPATH/src/github.com/$GITHUB_REPOSITORY
38-
mv -v $GITHUB_WORKSPACE $GOPATH/src/github.com/$GITHUB_REPOSITORY
39-
ln -vs $GOPATH/src/github.com/$GITHUB_REPOSITORY $GITHUB_WORKSPACE
40-
# go mod tidy
41-
go get -v ./...
42-
go build -v
44+
go mod tidy
45+
go build -v -trimpath
4346
go test -v ./...
47+
# for the next GoReleaser step
48+
git restore go.mod go.sum
4449
4550
-
4651
name: Run GoReleaser
47-
uses: goreleaser/goreleaser-action@v2
52+
uses: goreleaser/goreleaser-action@v5
4853
if: success() && startsWith(github.ref, 'refs/tags/')
4954
with:
5055
version: latest
51-
args: release --rm-dist
56+
args: release --clean
5257
env:
5358
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5459

0 commit comments

Comments
 (0)