Improve cache busting to consider the build scripts themselves (#633)

This commit is contained in:
Michael Telatynski 2023-04-26 15:04:17 +01:00 committed by GitHub
parent 5f5d8f08d0
commit 7b0040063b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 5 deletions

View File

@ -65,7 +65,7 @@ jobs:
id: cache id: cache
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
key: ${{ runner.os }}-${{ inputs.docker-image || github.ref_name }}-${{ inputs.sqlcipher }}-${{ inputs.arch }}-${{ hashFiles('hakDependencies.json', 'electronVersion') }} key: ${{ runner.os }}-${{ inputs.docker-image || github.ref_name }}-${{ inputs.sqlcipher }}-${{ inputs.arch }}-${{ hashFiles('hakHash', 'electronVersion') }}
path: | path: |
./.hak ./.hak

View File

@ -46,7 +46,7 @@ jobs:
id: cache id: cache
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
key: ${{ runner.os }}-${{ hashFiles('hakDependencies.json', 'electronVersion') }} key: ${{ runner.os }}-${{ hashFiles('hakHash', 'electronVersion') }}
path: | path: |
./.hak ./.hak

View File

@ -62,7 +62,9 @@ jobs:
- name: Generate cache hash files - name: Generate cache hash files
run: | run: |
yarn run --silent electron --version > electronVersion yarn run --silent electron --version > electronVersion
cat package.json | jq -c .hakDependencies > hakDependencies.json cat package.json | jq -c .hakDependencies | sha1sum > hakHash
find hak -type f -print0 | xargs -0 sha1sum >> hakHash
find scripts/hak -type f -print0 | xargs -0 sha1sum >> hakHash
- name: "[Nightly] Calculate versions" - name: "[Nightly] Calculate versions"
id: versions id: versions
@ -120,5 +122,5 @@ jobs:
webapp.asar webapp.asar
package.json package.json
electronVersion electronVersion
hakDependencies.json hakHash
changelog.Debian changelog.Debian

View File

@ -68,7 +68,7 @@ jobs:
id: cache id: cache
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
key: ${{ runner.os }}-${{ inputs.arch }}-${{ hashFiles('hakDependencies.json', 'electronVersion') }} key: ${{ runner.os }}-${{ inputs.arch }}-${{ hashFiles('hakHash', 'electronVersion') }}
path: | path: |
./.hak ./.hak