Use different Go cache key for goreleaser jobs (#1558)

## Changes

The goreleaser jobs perform a cross-platform build of the main binary
without test files. It should use a different cache than the jobs that
run tests for a single platform.

This change also updates the `release-snapshot` job to use the latest
goreleaser action, as was done in #1477.

## Tests

Ran `release-snapshot` job from this PR.
This commit is contained in:
Pieter Noordhuis 2024-07-04 13:39:55 +02:00 committed by GitHub
parent 80136dea5f
commit 8c3be30093
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 2 deletions

View File

@ -23,13 +23,21 @@ jobs:
with:
go-version: 1.22.x
# The default cache key for this action considers only the `go.sum` file.
# We include .goreleaser.yaml here to differentiate from the cache used by the push action
# that runs unit tests. This job produces and uses a different cache.
cache-dependency-path: |
go.sum
.goreleaser.yaml
- name: Hide snapshot tag to outsmart GoReleaser
run: git tag -d snapshot || true
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
id: releaser
uses: goreleaser/goreleaser-action@v6
with:
version: latest
version: ~> v2
args: release --snapshot --skip docker
- name: Upload macOS binaries

View File

@ -24,6 +24,13 @@ jobs:
with:
go-version: 1.22.x
# The default cache key for this action considers only the `go.sum` file.
# We include .goreleaser.yaml here to differentiate from the cache used by the push action
# that runs unit tests. This job produces and uses a different cache.
cache-dependency-path: |
go.sum
.goreleaser.yaml
# Log into the GitHub Container Registry. The goreleaser action will create
# the docker images and push them to the GitHub Container Registry.
- uses: "docker/login-action@v3"