Skip to content

Commit 5cc906f

Browse files
committed
Initial attempt to get file hashes when git checkout is done
1 parent 6c89081 commit 5cc906f

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

.github/autobuild/get_build_vars.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,7 @@ def set_github_variable(varname, varval):
103103
set_github_variable("IS_PRERELEASE", str(is_prerelease).lower())
104104
set_github_variable("RELEASE_TITLE", release_title)
105105
set_github_variable("RELEASE_TAG", release_tag)
106+
107+
set_github_variable("CACHE_KEY_MACOS", hashFiles(REPO_PATH + '.github/workflows/autobuild.yml', REPO_PATH + '.github/autobuild/mac.sh', REPO_PATH + 'mac/deploy_mac.sh') )
108+
set_github_variable("CACHE_KEY_WINDOWS", hashFiles(REPO_PATH + '.github/workflows/autobuild.yml', REPO_PATH + '.github/autobuild/windows.ps1', REPO_PATH + 'windows/deploy_windows.ps1') )
109+
set_github_variable("CACHE_KEY_ANDROID", hashFiles(REPO_PATH + '.github/workflows/autobuild.yml', REPO_PATH + '.github/autobuild/android.sh') )

.github/workflows/autobuild.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ jobs:
6767
publish_to_release: ${{ steps.get-build-vars.outputs.PUBLISH_TO_RELEASE }}
6868
tag_name: ${{ steps.get-build-vars.outputs.RELEASE_TAG }}
6969
build_version: ${{ steps.get-build-vars.outputs.BUILD_VERSION }}
70+
cache_key_macos: ${{ steps.get-build-vars.outputs.CACHE_KEY_MACOS }}
71+
cache_key_windows: ${{ steps.get-build-vars.outputs.CACHE_KEY_WINDOWS }}
72+
cache_key_android: ${{ steps.get-build-vars.outputs.CACHE_KEY_ANDROID }}
7073
build_all_targets: ${{ steps.decide-build-targets.outputs.build_all_targets }}
7174
env:
7275
release_changelog_path: ./.github_release_changelog.md
@@ -323,7 +326,7 @@ jobs:
323326
path: |
324327
~/qt
325328
~/Library/Cache/jamulus-dependencies
326-
key: ${{ matrix.config.target_os }}-${{ hashFiles('.github/workflows/autobuild.yml', '.github/autobuild/mac.sh', 'mac/deploy_mac.sh') }}-${{ matrix.config.base_command }}
329+
key: ${{ matrix.config.target_os }}-${{ steps.get-build-vars.outputs.CACHE_KEY_MACOS }}-${{ matrix.config.base_command }}
327330

328331
- name: Cache Windows dependencies
329332
if: matrix.config.target_os == 'windows'
@@ -335,7 +338,7 @@ jobs:
335338
C:\AutobuildCache
336339
${{ github.workspace }}\libs\NSIS\NSIS-source
337340
${{ github.workspace }}\libs\ASIOSDK2
338-
key: ${{ matrix.config.target_os }}-${{ hashFiles('.github/workflows/autobuild.yml', '.github/autobuild/windows.ps1', 'windows/deploy_windows.ps1') }}-${{ matrix.config.base_command }}
341+
key: ${{ matrix.config.target_os }}-${{ steps.get-build-vars.outputs.CACHE_KEY_WINDOWS }}-${{ matrix.config.base_command }}
339342

340343
- name: Cache Android dependencies
341344
if: matrix.config.target_os == 'android'
@@ -345,7 +348,7 @@ jobs:
345348
/opt/Qt
346349
/opt/android/android-sdk
347350
/opt/android/android-ndk
348-
key: ${{ matrix.config.target_os }}-${{ hashFiles('.github/workflows/autobuild.yml', '.github/autobuild/android.sh') }}-${{ matrix.config.base_command }}
351+
key: ${{ matrix.config.target_os }}-${{ steps.get-build-vars.outputs.CACHE_KEY_ANDROID }}-${{ matrix.config.base_command }}
349352

350353
- name: Set up build dependencies for ${{ matrix.config.config_name }}
351354
run: ${{ matrix.config.base_command }} setup

0 commit comments

Comments
 (0)