From b7fd314b810ed2d1996e5bd878a5ba5067c64ce5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Apayd=C4=B1n?= Date: Thu, 24 Feb 2022 10:27:34 +0300 Subject: [PATCH] chore(reproducibility): add buildid= and trimpath MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Batuhan Apaydın --- .github/workflows/release.yaml | 1 + .github/workflows/validations.yaml | 2 ++ .goreleaser.yaml | 3 +++ 3 files changed, 6 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4c461b941d93..efca1ac10154 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -140,6 +140,7 @@ jobs: # used during macOS notarization AC_USERNAME: ${{ secrets.ENG_CI_APPLE_ID }} AC_PASSWORD: ${{ secrets.ENG_CI_APPLE_ID_PASS }} + GOPATH: ${{ env.GOPATH }} - uses: anchore/sbom-action@v0 continue-on-error: true diff --git a/.github/workflows/validations.yaml b/.github/workflows/validations.yaml index 463e645a8c48..24e8f79937bf 100644 --- a/.github/workflows/validations.yaml +++ b/.github/workflows/validations.yaml @@ -180,6 +180,8 @@ jobs: - name: Build snapshot artifacts run: make snapshot + env: + GOPATH: ${{ env.GOPATH }} - uses: actions/upload-artifact@v2 with: diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 4164d1ea8dbb..d083bbda0e8a 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -22,7 +22,10 @@ builds: mod_timestamp: &build-timestamp '{{ .CommitTimestamp }}' env: &build-env - CGO_ENABLED=0 + gcflags: + - -trimpath={{.Env.GOPATH}} ldflags: &build-ldflags | + -buildid= -w -s -extldflags '-static'