File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,13 +44,17 @@ jobs:
4444 with :
4545 go-version : ' 1.21'
4646
47+ - name : Download dependencies
48+ run : go mod download
49+
4750 - name : Build binary
4851 env :
4952 GOOS : ${{ matrix.goos }}
5053 GOARCH : ${{ matrix.goarch }}
54+ CGO_ENABLED : 0
5155 run : |
5256 mkdir -p dist
53- go build -o dist/safekubectl-${GOOS} -${GOARCH} ./cmd/safekubectl/
57+ go build -o dist/safekubectl-${{ matrix.goos }} -${{ matrix.goarch }} ./cmd/safekubectl
5458
5559 - name : Upload artifact
5660 uses : actions/upload-artifact@v4
Original file line number Diff line number Diff line change 4343 with :
4444 go-version : ' 1.21'
4545
46+ - name : Download dependencies
47+ run : go mod download
48+
4649 - name : Get version from tag
4750 id : version
4851 run : echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
@@ -52,16 +55,16 @@ jobs:
5255 mkdir -p dist
5356
5457 # Linux amd64
55- GOOS=linux GOARCH=amd64 go build -ldflags "-X main.version=${{ steps.version.outputs.VERSION }}" -o dist/safekubectl-linux-amd64 ./cmd/safekubectl/
58+ CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-X main.version=${{ steps.version.outputs.VERSION }}" -o dist/safekubectl-linux-amd64 ./cmd/safekubectl
5659
5760 # Linux arm64
58- GOOS=linux GOARCH=arm64 go build -ldflags "-X main.version=${{ steps.version.outputs.VERSION }}" -o dist/safekubectl-linux-arm64 ./cmd/safekubectl/
61+ CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags "-X main.version=${{ steps.version.outputs.VERSION }}" -o dist/safekubectl-linux-arm64 ./cmd/safekubectl
5962
6063 # macOS amd64
61- GOOS=darwin GOARCH=amd64 go build -ldflags "-X main.version=${{ steps.version.outputs.VERSION }}" -o dist/safekubectl-darwin-amd64 ./cmd/safekubectl/
64+ CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags "-X main.version=${{ steps.version.outputs.VERSION }}" -o dist/safekubectl-darwin-amd64 ./cmd/safekubectl
6265
6366 # macOS arm64 (Apple Silicon)
64- GOOS=darwin GOARCH=arm64 go build -ldflags "-X main.version=${{ steps.version.outputs.VERSION }}" -o dist/safekubectl-darwin-arm64 ./cmd/safekubectl/
67+ CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags "-X main.version=${{ steps.version.outputs.VERSION }}" -o dist/safekubectl-darwin-arm64 ./cmd/safekubectl
6568
6669 - name : Create archives
6770 run : |
You can’t perform that action at this time.
0 commit comments