From 3cd34755404d5b9cb6e403cd311e1b3cab908bd7 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Tue, 19 Jul 2022 09:22:09 -0700 Subject: [PATCH] fix(ci): add package.json.version to code cachekey Before this, creating a release sometimes prevented vscode from rebuilding and using the cache instead. Now we use the package.json.version in the cache key to "bust" the cache if the package.json version is updated (aka a release). Fixes #5316 --- .github/workflows/ci.yaml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0eb615b01..8a2748337 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -143,14 +143,18 @@ jobs: id: vscode-rev run: echo "::set-output name=rev::$(git rev-parse HEAD:./lib/vscode)" - # We need to rebuild when we have a new version of Code or when any of - # the patches changed. Use VSCODE_CACHE_VERSION to force a rebuild. + - name: Get version + id: version + run: echo "::set-output name=version::$(jq -r .version package.json)" + + # We need to rebuild when we have a new version of Code or when any of + # the patches changed. Use VSCODE_CACHE_VERSION to force a rebuild. - name: Fetch prebuilt Code package from cache id: cache-vscode uses: actions/cache@v3 with: path: lib/vscode-reh-web-* - key: vscode-reh-package-${{ secrets.VSCODE_CACHE_VERSION }}-${{ steps.vscode-rev.outputs.rev }}-${{ hashFiles('patches/*.diff') }} + key: vscode-reh-package-${{ secrets.VSCODE_CACHE_VERSION }}-${{ steps.vscode-rev.outputs.rev }}-${{ steps.version.outputs.version }}-${{ hashFiles('patches/*.diff') }} - name: Build vscode if: steps.cache-vscode.outputs.cache-hit != 'true'