@@ -31,14 +31,11 @@ jobs:
3131 uses : actions/setup-node@v3
3232 with :
3333 node-version : 16.18.1
34- - name : Setup SHA variable
35- shell : bash
36- run : echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
3734 - name : Setup Cache
3835 uses : actions/cache@v3.2.3
3936 with :
4037 path : dist/${{ matrix.goos }}
41- key : ${{ matrix.goos }}-${{ env.sha_short }}
38+ key : ${{ matrix.goos }}-${{ github.ref_name }}
4239 enableCrossOsArchive : true
4340 - name : Install Dependencies
4441 if : matrix.goos == 'linux'
4946 - name : Build web
5047 shell : bash
5148 run : make build-web
49+ - name : Get Previous Tag
50+ id : prev
51+ uses : WyriHaximus/github-action-get-previous-tag@v1
52+ env :
53+ INPUT_PREFIX : v
5254 - name : GoReleaser (Build)
5355 uses : goreleaser/goreleaser-action@v4
5456 with :
6365 GITLAB_CLIENT_SECRET : ${{ secrets.GITLAB_CLIENT_SECRET }}
6466 HOMEBREW_TAP_GITHUB_TOKEN : ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
6567 GORELEASER_CURRENT_TAG : ${{ github.ref_name }}
68+ GORELEASER_PREVIOUS_TAG : ${{ steps.release.outputs.prev }}
6669
6770 # Release binaries with GoReleaser
6871 release :
@@ -86,17 +89,17 @@ jobs:
8689 uses : actions/cache@v3.2.3
8790 with :
8891 path : dist/linux
89- key : linux-${{ env.sha_short }}
92+ key : linux-${{ github.ref_name }}
9093 - name : Restore Darwin Cache
9194 uses : actions/cache@v3.2.3
9295 with :
9396 path : dist/darwin
94- key : darwin-${{ env.sha_short }}
97+ key : darwin-${{ github.ref_name }}
9598 - name : Restore Windows Cache
9699 uses : actions/cache@v3.2.3
97100 with :
98101 path : dist/windows
99- key : windows-${{ env.sha_short }}
102+ key : windows-${{ github.ref_name }}
100103 enableCrossOsArchive : true
101104 - name : Get Previous Tag
102105 id : prev
0 commit comments