diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 083bb86490..1729d9ec20 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -11,6 +11,16 @@ jobs: docker: runs-on: ubuntu-latest steps: + - name: Maximize build space + uses: easimon/maximize-build-space@v10 + with: + root-reserve-mb: 32768 + remove-dotnet: "true" + remove-android: "true" + remove-haskell: "true" + remove-codeql: "true" + remove-docker-images: "true" + - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml index 147d00569f..89d967097c 100644 --- a/.github/workflows/goreleaser.yml +++ b/.github/workflows/goreleaser.yml @@ -9,6 +9,16 @@ jobs: goreleaser: runs-on: ubuntu-latest steps: + - + name: Maximize build space + uses: easimon/maximize-build-space@v10 + with: + root-reserve-mb: 32768 + remove-dotnet: "true" + remove-android: "true" + remove-haskell: "true" + remove-codeql: "true" + remove-docker-images: "true" - name: Checkout uses: actions/checkout@v4 @@ -20,13 +30,6 @@ jobs: uses: actions/setup-go@v5 with: go-version-file: go.mod - - - name: Clean space as per https://github.com/actions/virtual-environments/issues/709 - run: | - sudo rm -rf "/opt/ghc" || true - sudo rm -rf "/usr/share/dotnet" || true - sudo rm -rf "/usr/local/lib/android" || true - sudo rm -rf "/usr/local/share/boost" || true - name: Run GoReleaser uses: goreleaser/goreleaser-action@v6 diff --git a/.goreleaser.yml b/.goreleaser.yml index 02a306e306..8e3289bde4 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -18,6 +18,7 @@ builds: main: ./cmd/vuls/main.go flags: - -a + - -trimpath ldflags: - -s -w -X github.com/future-architect/vuls/config.Version={{.Version}} -X github.com/future-architect/vuls/config.Revision={{.Commit}}-{{ .CommitDate }} binary: vuls @@ -30,15 +31,14 @@ builds: - windows - darwin goarch: - - 386 - amd64 - - arm - arm64 main: ./cmd/scanner/main.go - flags: - - -a tags: - scanner + flags: + - -a + - -trimpath ldflags: - -s -w -X github.com/future-architect/vuls/config.Version={{.Version}} -X github.com/future-architect/vuls/config.Revision={{.Commit}}-{{ .CommitDate }} binary: vuls-scanner @@ -51,13 +51,14 @@ builds: - windows - darwin goarch: - - 386 - amd64 - - arm - arm64 + main: ./contrib/trivy/cmd/main.go tags: - scanner - main: ./contrib/trivy/cmd/main.go + flags: + - -a + - -trimpath ldflags: - -s -w -X github.com/future-architect/vuls/config.Version={{.Version}} -X github.com/future-architect/vuls/config.Revision={{.Commit}}-{{ .CommitDate }} binary: trivy-to-vuls @@ -70,14 +71,13 @@ builds: - windows - darwin goarch: - - 386 - amd64 - - arm - arm64 - flags: - - -a tags: - scanner + flags: + - -a + - -trimpath ldflags: - -s -w -X github.com/future-architect/vuls/config.Version={{.Version}} -X github.com/future-architect/vuls/config.Revision={{.Commit}}-{{ .CommitDate }} main: ./contrib/future-vuls/cmd/main.go @@ -91,14 +91,13 @@ builds: - windows - darwin goarch: - - 386 - amd64 - - arm - arm64 - flags: - - -a tags: - scanner + flags: + - -a + - -trimpath ldflags: - -s -w -X github.com/future-architect/vuls/config.Version={{.Version}} -X github.com/future-architect/vuls/config.Revision={{.Commit}}-{{ .CommitDate }} main: ./contrib/snmp2cpe/cmd/main.go diff --git a/GNUmakefile b/GNUmakefile index 4112778c32..926d5acbff 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -24,22 +24,22 @@ GO_WINDOWS := GOOS=windows GOARCH=amd64 $(GO) all: build test build: ./cmd/vuls/main.go - $(GO) build -a -ldflags "$(LDFLAGS)" -o vuls ./cmd/vuls + $(GO) build -a -trimpath -ldflags "$(LDFLAGS)" -o vuls ./cmd/vuls build-windows: ./cmd/vuls/main.go - $(GO_WINDOWS) build -a -ldflags " $(LDFLAGS)" -o vuls.exe ./cmd/vuls + $(GO_WINDOWS) build -a -trimpath -ldflags " $(LDFLAGS)" -o vuls.exe ./cmd/vuls install: ./cmd/vuls/main.go - $(GO) install -ldflags "$(LDFLAGS)" ./cmd/vuls + $(GO) install -a -trimpath -ldflags "$(LDFLAGS)" ./cmd/vuls build-scanner: ./cmd/scanner/main.go - $(GO) build -tags=scanner -a -ldflags "$(LDFLAGS)" -o vuls ./cmd/scanner + $(GO) build -tags=scanner -a -trimpath -ldflags "$(LDFLAGS)" -o vuls ./cmd/scanner build-scanner-windows: ./cmd/scanner/main.go - $(GO_WINDOWS) build -tags=scanner -a -ldflags " $(LDFLAGS)" -o vuls.exe ./cmd/scanner + $(GO_WINDOWS) build -tags=scanner -a -trimpath -ldflags " $(LDFLAGS)" -o vuls.exe ./cmd/scanner install-scanner: ./cmd/scanner/main.go - $(GO) install -tags=scanner -ldflags "$(LDFLAGS)" ./cmd/scanner + $(GO) install -a -trimpath -tags=scanner -ldflags "$(LDFLAGS)" ./cmd/scanner lint: go install github.com/mgechev/revive@latest