fix(ci): use explicit Go binary paths in CI/CD workflow
Update the CI/CD workflow to reference the full path to Go binaries (/usr/local/go/bin/go, gofmt) instead of relying on PATH resolution. This ensures the correct Go version is used when running in the Docker container where the binary location may differ from the default PATH expectation.
This commit is contained in:
14
.github/workflows/ci-cd.yml
vendored
14
.github/workflows/ci-cd.yml
vendored
@@ -15,16 +15,16 @@ jobs:
|
||||
run: git clone "${{ secrets.G_CLONE_URL }}" .
|
||||
|
||||
- name: Set go proxy mirror
|
||||
run: go env -w GOPROXY=https://go.iranserver.com/repository/go/ && go env -w GOSUMDB=off
|
||||
run: /usr/local/go/bin/go env -w GOPROXY=https://go.iranserver.com/repository/go/ && /usr/local/go/bin/go env -w GOSUMDB=off
|
||||
|
||||
- name: Download dependencies
|
||||
run: go mod download
|
||||
run: /usr/local/go/bin/go mod download
|
||||
|
||||
- name: Check formatting
|
||||
run: |
|
||||
if [ "$(gofmt -l $(find . -name '*.go' -not -path './vendor/*'))" ]; then
|
||||
if [ "$(/usr/local/go/bin/gofmt -l $(find . -name '*.go' -not -path './vendor/*'))" ]; then
|
||||
echo "Files not properly formatted:"
|
||||
gofmt -l $(find . -name '*.go' -not -path './vendor/*')
|
||||
/usr/local/go/bin/gofmt -l $(find . -name '*.go' -not -path './vendor/*')
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -37,13 +37,13 @@ jobs:
|
||||
run: git clone "${{ secrets.G_CLONE_URL }}" .
|
||||
|
||||
- name: Build for Linux amd64
|
||||
run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o auth-gate-linux-amd64 .
|
||||
run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 /usr/local/go/bin/go build -o auth-gate-linux-amd64 .
|
||||
|
||||
- name: Build for Linux arm64
|
||||
run: CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o auth-gate-linux-arm64 .
|
||||
run: CGO_ENABLED=0 GOOS=linux GOARCH=arm64 /usr/local/go/bin/go build -o auth-gate-linux-arm64 .
|
||||
|
||||
- name: Build for Windows amd64
|
||||
run: CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o auth-gate-windows-amd64.exe
|
||||
run: CGO_ENABLED=0 GOOS=windows GOARCH=amd64 /usr/local/go/bin/go build -o auth-gate-windows-amd64.exe
|
||||
|
||||
- name: Package binaries
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user