From 7b0040063bb402095a9ddfd2e2c3a9622923fcaa Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 26 Apr 2023 15:04:17 +0100 Subject: [PATCH] Improve cache busting to consider the build scripts themselves (#633) --- .github/workflows/build_linux.yaml | 2 +- .github/workflows/build_macos.yaml | 2 +- .github/workflows/build_prepare.yaml | 6 ++++-- .github/workflows/build_windows.yaml | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_linux.yaml b/.github/workflows/build_linux.yaml index 70fb5d9..392bb14 100644 --- a/.github/workflows/build_linux.yaml +++ b/.github/workflows/build_linux.yaml @@ -65,7 +65,7 @@ jobs: id: cache uses: actions/cache@v3 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: | ./.hak diff --git a/.github/workflows/build_macos.yaml b/.github/workflows/build_macos.yaml index 733edbc..1833889 100644 --- a/.github/workflows/build_macos.yaml +++ b/.github/workflows/build_macos.yaml @@ -46,7 +46,7 @@ jobs: id: cache uses: actions/cache@v3 with: - key: ${{ runner.os }}-${{ hashFiles('hakDependencies.json', 'electronVersion') }} + key: ${{ runner.os }}-${{ hashFiles('hakHash', 'electronVersion') }} path: | ./.hak diff --git a/.github/workflows/build_prepare.yaml b/.github/workflows/build_prepare.yaml index 3cc86df..2d74ee2 100644 --- a/.github/workflows/build_prepare.yaml +++ b/.github/workflows/build_prepare.yaml @@ -62,7 +62,9 @@ jobs: - name: Generate cache hash files run: | 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" id: versions @@ -120,5 +122,5 @@ jobs: webapp.asar package.json electronVersion - hakDependencies.json + hakHash changelog.Debian diff --git a/.github/workflows/build_windows.yaml b/.github/workflows/build_windows.yaml index f156081..591a6d4 100644 --- a/.github/workflows/build_windows.yaml +++ b/.github/workflows/build_windows.yaml @@ -68,7 +68,7 @@ jobs: id: cache uses: actions/cache@v3 with: - key: ${{ runner.os }}-${{ inputs.arch }}-${{ hashFiles('hakDependencies.json', 'electronVersion') }} + key: ${{ runner.os }}-${{ inputs.arch }}-${{ hashFiles('hakHash', 'electronVersion') }} path: | ./.hak