From 3d87b3d91f7322d67253ec3ca589f3c54c9fa646 Mon Sep 17 00:00:00 2001 From: Daniel Bennett Date: Thu, 6 Jul 2023 12:47:43 -0500 Subject: [PATCH] ci: clean GOCACHE before build (#17808) this is basically to avoid Fear/Uncertainty/Doubt the github action actions/setup-go (and, with a different chache key, hashicorp/setup-golang) caches both GOMODCACHE (go source files), which is good, and GOCACHE (build outputs), which *might* be bad, if the cache was built on an OS with an older glibc than we want to support. from `go help cache`: > [...] the build cache does not detect changes to > C libraries imported with cgo. --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 021cb49f1..9de13de79 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -118,6 +118,7 @@ jobs: GO_TAGS: ${{ env.GO_TAGS }} CGO_ENABLED: 1 run: | + go clean -cache make pkg/${{ matrix.goos }}_${{ matrix.goarch }}.zip mv pkg/${{ matrix.goos }}_${{ matrix.goarch }}.zip ${{ env.PKG_NAME }}_${{ needs.get-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 @@ -189,6 +190,7 @@ jobs: GO_TAGS: ${{ env.GO_TAGS }} CGO_ENABLED: 1 run: | + go clean -cache make pkg/${{ matrix.goos }}_${{ matrix.goarch }}.zip mv pkg/${{ matrix.goos }}_${{ matrix.goarch }}.zip ${{ env.PKG_NAME }}_${{ needs.get-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 @@ -274,6 +276,7 @@ jobs: GO_TAGS: "${{ env.GO_TAGS }} netcgo" CGO_ENABLED: 1 run: | + go clean -cache make pkg/${{ matrix.goos }}_${{ matrix.goarch }}.zip mv pkg/${{ matrix.goos }}_${{ matrix.goarch }}.zip ${{ env.PKG_NAME }}_${{ needs.get-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2