diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c2bd8c2a..c5474ac9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -71,12 +71,15 @@ jobs: verbose: 1 create-symlink: true - - name: Setup cache for clcache + - name: Restore cache for clcache + id: clcache-restore if: ${{ matrix.platform == 'windows-latest' }} - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: ${{ github.workspace }}\.clcache - key: ${{ github.job }}-${{ matrix.platform }} + key: ${{ github.job }}-${{ matrix.platform }}-${{ github.sha }} + restore-keys: | + ${{ github.job }}-${{ matrix.platform }}- - name: Create sbom, binary & package env: @@ -91,6 +94,13 @@ jobs: python script/build.py python script/package.py + - name: Save cache for clcache + if: ${{ always() && matrix.platform == 'windows-latest' && steps.clcache-restore.outputs.cache-hit != 'true' }} + uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + with: + path: ${{ github.workspace }}\.clcache + key: ${{ steps.clcache-restore.outputs.cache-primary-key }} + - name: Store the distribution packages uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: