Skip to content

Commit 3cd3475

Browse files
committed
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
1 parent 6372aea commit 3cd3475

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

.github/workflows/ci.yaml

+7-3
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,18 @@ jobs:
143143
id: vscode-rev
144144
run: echo "::set-output name=rev::$(git rev-parse HEAD:./lib/vscode)"
145145

146-
# We need to rebuild when we have a new version of Code or when any of
147-
# the patches changed. Use VSCODE_CACHE_VERSION to force a rebuild.
146+
- name: Get version
147+
id: version
148+
run: echo "::set-output name=version::$(jq -r .version package.json)"
149+
150+
# We need to rebuild when we have a new version of Code or when any of
151+
# the patches changed. Use VSCODE_CACHE_VERSION to force a rebuild.
148152
- name: Fetch prebuilt Code package from cache
149153
id: cache-vscode
150154
uses: actions/cache@v3
151155
with:
152156
path: lib/vscode-reh-web-*
153-
key: vscode-reh-package-${{ secrets.VSCODE_CACHE_VERSION }}-${{ steps.vscode-rev.outputs.rev }}-${{ hashFiles('patches/*.diff') }}
157+
key: vscode-reh-package-${{ secrets.VSCODE_CACHE_VERSION }}-${{ steps.vscode-rev.outputs.rev }}-${{ steps.version.outputs.version }}-${{ hashFiles('patches/*.diff') }}
154158

155159
- name: Build vscode
156160
if: steps.cache-vscode.outputs.cache-hit != 'true'

0 commit comments

Comments
 (0)