From 1b64bdcb3d2ab9e4ae8feb458a14a7d5614300d2 Mon Sep 17 00:00:00 2001 From: Timur Sultanaev Date: Sun, 1 Dec 2024 16:38:07 +0100 Subject: [PATCH] add caching for goreleaser bin --- .github/workflows/cache-goreleaser.yaml | 31 +++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/cache-goreleaser.yaml diff --git a/.github/workflows/cache-goreleaser.yaml b/.github/workflows/cache-goreleaser.yaml new file mode 100644 index 0000000..4313f9d --- /dev/null +++ b/.github/workflows/cache-goreleaser.yaml @@ -0,0 +1,31 @@ +name: Cache goreleaser + +# This workflow exists only to create cache for goreleaser binary +# so that it can be used in the release workflow, that runs on tags +# and cannot reuse caches from other runs except for the same tag or default branch + +on: + workflow_dispatch: + push: + branches: + - main + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.23.3' + + - name: Cache installed binaries + uses: actions/cache@v4 + with: + path: /home/runner/go/bin + key: ${{ runner.os }}-goreleaser + + - name: Install goreleaser + run: | + go install github.com/goreleaser/goreleaser/v2@latest + which goreleaser