From dcbb10588965d65e3afeade3908264c4303c52f4 Mon Sep 17 00:00:00 2001 From: michaeljguarino Date: Mon, 22 Apr 2024 11:09:32 -0400 Subject: [PATCH] potentially help goreleaser out --- .github/workflows/goreleaser-cd.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/goreleaser-cd.yml b/.github/workflows/goreleaser-cd.yml index 95df8cd6..406086ca 100644 --- a/.github/workflows/goreleaser-cd.yml +++ b/.github/workflows/goreleaser-cd.yml @@ -31,14 +31,11 @@ jobs: uses: actions/setup-node@v3 with: node-version: 16.18.1 - - name: Setup SHA variable - shell: bash - run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV - name: Setup Cache uses: actions/cache@v3.2.3 with: path: dist/${{ matrix.goos }} - key: ${{ matrix.goos }}-${{ env.sha_short }} + key: ${{ matrix.goos }}-${{ github.ref_name }} enableCrossOsArchive: true - name: Install Dependencies if: matrix.goos == 'linux' @@ -49,6 +46,11 @@ jobs: - name: Build web shell: bash run: make build-web + - name: Get Previous Tag + id: prev + uses: WyriHaximus/github-action-get-previous-tag@v1 + env: + INPUT_PREFIX: v - name: GoReleaser (Build) uses: goreleaser/goreleaser-action@v4 with: @@ -63,6 +65,7 @@ jobs: GITLAB_CLIENT_SECRET: ${{ secrets.GITLAB_CLIENT_SECRET }} HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }} GORELEASER_CURRENT_TAG: ${{ github.ref_name }} + GORELEASER_PREVIOUS_TAG: ${{ steps.release.outputs.prev }} # Release binaries with GoReleaser release: @@ -86,17 +89,17 @@ jobs: uses: actions/cache@v3.2.3 with: path: dist/linux - key: linux-${{ env.sha_short }} + key: linux-${{ github.ref_name }} - name: Restore Darwin Cache uses: actions/cache@v3.2.3 with: path: dist/darwin - key: darwin-${{ env.sha_short }} + key: darwin-${{ github.ref_name }} - name: Restore Windows Cache uses: actions/cache@v3.2.3 with: path: dist/windows - key: windows-${{ env.sha_short }} + key: windows-${{ github.ref_name }} enableCrossOsArchive: true - name: Get Previous Tag id: prev