diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8ab5626b2..e03057f59 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -80,6 +80,31 @@ jobs: with: fetch-depth: 0 + - name: Setup Go + uses: actions/setup-go@v2 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Find the Go Cache + id: go + run: | + echo "::set-output name=build-cache::$(go env GOCACHE)" + echo "::set-output name=mod-cache::$(go env GOMODCACHE)" + + - name: Cache the Go Build Cache + uses: actions/cache@v3 + with: + path: ${{ steps.go.outputs.build-cache }} + key: ${{ runner.os }}-build-publish-artifacts-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ runner.os }}-build-publish-artifacts- + + - name: Cache Go Dependencies + uses: actions/cache@v3 + with: + path: ${{ steps.go.outputs.mod-cache }} + key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ runner.os }}-pkg- + - name: Login to Docker uses: docker/login-action@v1 if: env.GHCR_USERNAME != ''