From e54a6854839552099d55de45e2cdbd081763840d Mon Sep 17 00:00:00 2001 From: Ramkumar Chinchani <45800463+rchincha@users.noreply.github.com> Date: Mon, 19 Dec 2022 10:44:53 -0800 Subject: [PATCH] ci: upload binary with the tag (#372) Signed-off-by: Ramkumar Chinchani Signed-off-by: Ramkumar Chinchani --- .github/workflows/build.yaml | 5 +++-- .github/workflows/release.yaml | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index e561a0a8..f5d599a0 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -53,8 +53,9 @@ jobs: make check VERSION_FULL=${{ github.event.release.tag_name }}-${{ steps.short-sha.outputs.sha }} PRIVILEGE_LEVEL=${{ matrix.privilege-level }} env: REGISTRY_URL: localhost:5000 - - uses: actions/cache@v3 + - if: github.event_name == 'release' && github.event.action == 'published' + uses: actions/cache@v3 id: restore-build with: path: stacker - key: ${{ github.sha }} + key: ${{ github.event.release.tag_name }}-${{ steps.short-sha.outputs.sha }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3a7ec17a..b002c4d1 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -21,11 +21,13 @@ jobs: # needs ci for the cached stacker binary needs: ci steps: + - uses: benjlevesque/short-sha@v2.1 + id: short-sha - uses: actions/cache@v3 id: restore-build with: path: stacker - key: ${{ github.sha }} + key: ${{ github.event.release.tag_name }}-${{ steps.short-sha.outputs.sha }} - if: github.event_name == 'release' && github.event.action == 'published' name: Publish artifacts on releases uses: svenstaro/upload-release-action@v2