chore: rebuild binary with latest changes #47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This workflow will build a golang project | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | |
| name: Go | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| pull_request: | |
| branches: [ "master" ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: '1.23.6' | |
| - name: Verify Modules | |
| run: go mod verify | |
| - name: Run Vulnerability Check | |
| run: go run golang.org/x/vuln/cmd/govulncheck@latest ./... | |
| - name: Run Static Analysis | |
| run: go run honnef.co/go/tools/cmd/staticcheck@latest -checks=all,-ST1000,-U1000 ./... | |
| - name: Run Golangci-lint | |
| run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.64.2 | |
| - name: Build for Linux | |
| run: | | |
| CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o ./bin/gcli . | |
| sudo cp ./bin/gcli /usr/bin/ | |
| - name: Build for Darwin AMD64 | |
| run: | | |
| CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -o ./bin/gcli . | |
| mkdir -p ~/bin | |
| cp ./bin/gcli ~/bin/ | |
| - name: Build for Darwin ARM64 | |
| run: | | |
| CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -o ./bin/gcli . | |
| mkdir -p ~/bin | |
| cp ./bin/gcli ~/bin/ | |
| - name: Build for Windows | |
| run: CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o ./bin/gcli.exe | |
| - name: Install | |
| run: go install . | |
| - name: Test | |
| run: go test -v ./... |