Skip to content

Commit

Permalink
Use different Go cache key for goreleaser jobs (#1558)
Browse files Browse the repository at this point in the history
## 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.
  • Loading branch information
pietern authored Jul 4, 2024
1 parent 80136de commit 8c3be30
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/release-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 8c3be30

Please sign in to comment.