feat: cache the goreleaser binary

Look for GoReleaser in the runner tool cache before a download. This
makes a second use of the action in the same job, or any job on a
self-hosted runner, install immediately.

Add an opt-in `cache-binary` input that also stores the binary in the
GitHub Actions cache. When it hits, the action does not download the
release archive, the checksums and the signature bundle again. Cache
errors are not fatal and fall back to a download.

The runner tool cache entry is now keyed by distribution, so a Pro
binary is no longer returned for an OSS install of the same version.

Closes #476

Co-authored-by: timbretimber <105982513+timbretimber@users.noreply.github.com>
Co-authored-by: Akkuman <akkumans@qq.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
Carlos Alexandro Becker
2026-08-29 15:19:02 -03:00
co-authored by timbretimber Akkuman Copilot
parent 59060fdcfd
commit fa7c11c5a3
12 changed files with 1809 additions and 27 deletions
+22
View File
@@ -100,6 +100,28 @@ jobs:
run: |
goreleaser check --verbose
cache-binary:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
# The first workflow run saves the binary, later runs restore it.
- name: GoReleaser
uses: ./
with:
version: '~> v2'
install-only: true
cache-binary: true
- name: Check
run: goreleaser --version
signing:
runs-on: ${{ matrix.os }}
if: github.event_name != 'pull_request'