mirror of https://github.com/coder/code-server.git
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
This commit is contained in:
parent
6372aea4ba
commit
3cd3475540
|
@ -143,6 +143,10 @@ jobs:
|
|||
id: vscode-rev
|
||||
run: echo "::set-output name=rev::$(git rev-parse HEAD:./lib/vscode)"
|
||||
|
||||
- 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
|
||||
|
@ -150,7 +154,7 @@ jobs:
|
|||
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'
|
||||
|
|
Loading…
Reference in New Issue