Skip to content

Commit fdae3db

Browse files
committed
Externalise cache keys to prevent unneeded invalidation
1 parent 11a28d5 commit fdae3db

8 files changed

Lines changed: 55 additions & 24 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
# Values are consumed by ios.sh and the dependency cache key.
4+
# shellcheck disable=SC2034
5+
export AQTINSTALL_VERSION="${AQTINSTALL_VERSION:-3.3.0}"
6+
export QT_VERSION="${QT_VERSION:-5.15.2}"

.github/autobuild/ios.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,12 @@
4848

4949
set -eu
5050

51+
PROJECT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
52+
readonly PROJECT_DIR
53+
# shellcheck disable=SC1091
54+
source "${PROJECT_DIR}/.github/autobuild/ios-dependencies.sh"
55+
5156
QT_DIR=/opt/qt
52-
# The following version pinnings are semi-automatically checked for
53-
# updates. Verify .github/workflows/bump-dependencies.yaml when changing those manually:
54-
AQTINSTALL_VERSION=3.3.0
5557

5658
if [[ ! ${QT_VERSION:-} =~ [0-9]+\.[0-9]+\..* ]]; then
5759
echo "Environment variable QT_VERSION must be set to a valid Qt version"
@@ -63,7 +65,7 @@ if [[ ! ${JAMULUS_BUILD_VERSION:-} =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then
6365
fi
6466

6567
setup() {
66-
if [[ -d "${QT_DIR}" ]]; then
68+
if [[ -x "${QT_DIR}/${QT_VERSION}/ios/bin/qmake" ]]; then
6769
echo "Using Qt installation from previous run (actions/cache)"
6870
else
6971
echo "Installing Qt"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
# Values are consumed by mac.sh and the dependency cache key.
4+
# shellcheck disable=SC2034
5+
export AQTINSTALL_VERSION="${AQTINSTALL_VERSION:-3.3.0}"
6+
export QT_VERSION="${QT_VERSION:-6.10.2}"
7+
export QT_LEGACY_VERSION=5.15.2

.github/autobuild/mac.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,12 @@
4848

4949
set -eu
5050

51+
PROJECT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
52+
readonly PROJECT_DIR
53+
# shellcheck disable=SC1091
54+
source "${PROJECT_DIR}/.github/autobuild/mac-dependencies.sh"
55+
5156
QT_DIR=~/qt
52-
# The following version pinnings are semi-automatically checked for
53-
# updates. Verify .github/workflows/bump-dependencies.yaml when changing those manually:
54-
AQTINSTALL_VERSION=3.3.0
5557

5658
TARGET_ARCHS="${TARGET_ARCHS:-}"
5759

@@ -65,7 +67,8 @@ if [[ ! ${JAMULUS_BUILD_VERSION:-} =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then
6567
fi
6668

6769
setup() {
68-
if [[ -d "${QT_DIR}" ]]; then
70+
if [[ -x "${QT_DIR}/${QT_VERSION}/macos/bin/qmake" &&
71+
-x "${QT_DIR}/${QT_VERSION}/macos/bin/macdeployqt" ]]; then
6972
echo "Using Qt installation from previous run (actions/cache)"
7073
else
7174
echo "Installing Qt..."
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Values are consumed by windows.ps1 and the dependency cache key.
2+
$Qt32Version = "5.15.2"
3+
$Qt64Version = "6.10.2"
4+
$AqtinstallVersion = "3.3.0"
5+
$JackVersion = "1.9.22"
6+
$Msvc32Version = "win32_msvc2019"
7+
$Msvc64Version = "win64_msvc2022_64"
8+
$JomVersion = "1.1.2"

.github/autobuild/windows.ps1

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,7 @@ $ProgressPreference = 'SilentlyContinue'
6868
$QtDir = 'C:\Qt'
6969
$ChocoCacheDir = 'C:\ChocoCache'
7070
$DownloadCacheDir = 'C:\AutobuildCache'
71-
# The following version pinnings are semi-automatically checked for
72-
# updates. Verify .github/workflows/bump-dependencies.yaml when changing those manually:
73-
$Qt32Version = "5.15.2"
74-
$Qt64Version = "6.10.2"
75-
$AqtinstallVersion = "3.3.0"
76-
$JackVersion = "1.9.22"
77-
$Msvc32Version = "win32_msvc2019"
78-
$Msvc64Version = "win64_msvc2022_64"
79-
$JomVersion = "1.1.2"
71+
. "$PSScriptRoot\windows-dependencies.ps1"
8072

8173
# Compose JACK download urls
8274
$JackBaseUrl = "https://github.com/jackaudio/jack2-releases/releases/download/v${JackVersion}/jack2-win"
@@ -150,7 +142,8 @@ Function Install-Qt
150142

151143
Function Ensure-Qt
152144
{
153-
if ( Test-Path -Path $QtDir )
145+
if ( (Test-Path -Path "$QtDir\$Qt32Version\bin\qmake.exe" -PathType Leaf) -and
146+
(Test-Path -Path "$QtDir\$Qt64Version\bin\qmake.exe" -PathType Leaf) )
154147
{
155148
echo "Using Qt installation from previous run (actions/cache)"
156149
return

.github/workflows/autobuild.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ jobs:
230230
# Disable CodeQL on mac as it interferes with signing the binaries (signing hangs, see #2563 and #2564)
231231
run_codeql: false
232232
xcode_version: 16.3.0
233+
dependency_cache_key: qt6
233234
is_main_build_target: true
234235

235236
# Reminder: If Legacy is removed, be sure to add a dedicated job for CodeQL again.
@@ -243,6 +244,7 @@ jobs:
243244
# https://developer.apple.com/support/xcode/
244245
# https://xcodereleases.com/
245246
xcode_version: 16.3.0
247+
dependency_cache_key: qt5
246248
is_main_build_target: true
247249

248250
- config_name: iOS (artifacts)
@@ -254,19 +256,22 @@ jobs:
254256
# Therefore, disable it:
255257
run_codeql: false
256258
xcode_version: 26.2
259+
dependency_cache_key: ios
257260

258261
- config_name: Windows (artifact+codeQL)
259262
target_os: windows
260263
building_on_os: windows-2025
261264
base_command: powershell .\.github\autobuild\windows.ps1 -Stage
262265
run_codeql: true
266+
dependency_cache_key: asio
263267
is_main_build_target: true
264268

265269
- config_name: Windows JACK (artifact)
266270
target_os: windows
267271
building_on_os: windows-2025
268272
base_command: powershell .\.github\autobuild\windows.ps1 -BuildOption jackonwindows -Stage
269273
run_codeql: false
274+
dependency_cache_key: jack
270275

271276
# This injects the build_all_targets information into each matrix output:
272277
build_all_targets:
@@ -300,7 +305,14 @@ jobs:
300305
path: |
301306
~/qt
302307
~/Library/Cache/jamulus-dependencies
303-
key: ${{ matrix.config.target_os }}-${{ hashFiles('.github/workflows/autobuild.yml', '.github/autobuild/mac.sh', 'mac/deploy_mac.sh') }}-${{ matrix.config.base_command }}
308+
key: ${{ matrix.config.target_os }}-${{ hashFiles('.github/autobuild/mac-dependencies.sh') }}-${{ matrix.config.dependency_cache_key }}
309+
310+
- name: Cache iOS dependencies
311+
if: matrix.config.target_os == 'ios'
312+
uses: actions/cache@v6
313+
with:
314+
path: /opt/qt
315+
key: ${{ matrix.config.target_os }}-${{ hashFiles('.github/autobuild/ios-dependencies.sh') }}-${{ matrix.config.dependency_cache_key }}
304316

305317
- name: Cache Windows dependencies
306318
if: matrix.config.target_os == 'windows'
@@ -312,7 +324,7 @@ jobs:
312324
C:\AutobuildCache
313325
${{ github.workspace }}\libs\NSIS\NSIS-source
314326
${{ github.workspace }}\libs\ASIOSDK2
315-
key: ${{ matrix.config.target_os }}-${{ hashFiles('.github/workflows/autobuild.yml', '.github/autobuild/windows.ps1', 'windows/deploy_windows.ps1') }}-${{ matrix.config.base_command }}
327+
key: ${{ matrix.config.target_os }}-${{ hashFiles('.github/autobuild/windows-dependencies.ps1', 'windows/deploy_windows.ps1') }}-${{ matrix.config.dependency_cache_key }}
316328

317329
- name: Cache Android dependencies
318330
if: matrix.config.target_os == 'android'

.github/workflows/bump-dependencies.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ jobs:
3939
- name: aqt
4040
# not Changelog-worthy
4141
get_upstream_version: GH_REPO=miurahr/aqtinstall gh release view --json tagName --jq .tagName | sed -re 's/^v//'
42-
# The following regexps capture both the *nix and the Windows variable syntax (different case, underscore):
43-
local_version_regex: (.*AQTINSTALL_?VERSION\s*=\s*"?)([0-9.]*)("?.*)
42+
# Capture both plain assignments and shell parameter-expansion defaults.
43+
local_version_regex: (.*AQTINSTALL_?VERSION\s*=\s*"?[^0-9]*)([0-9.]+)(.*)
4444
- name: create-dmg
4545
changelog_name: create-dmg (macOS)
4646
get_upstream_version: GH_REPO=create-dmg/create-dmg gh release view --json tagName --jq .tagName | sed -re 's/^v//'
@@ -50,8 +50,8 @@ jobs:
5050
get_upstream_version: |
5151
latest_minor="$(curl -s https://download.qt.io/official_releases/qt/ | grep -oP 'href="\K[0-9.]+(?=/")' | sort --reverse --version-sort | head -n1)";
5252
curl -s https://download.qt.io/official_releases/qt/"${latest_minor}"/ | grep -oP 'href="\K[0-9.]+(?=/")' | sort --reverse --version-sort | head -n1
53-
# The following regex captures both the *nix and the Windows variable syntax (different case, underscore):
54-
local_version_regex: (.*QT[0-9_]+VERSION\s*=\s*"?)(6\.[0-9.]+)("?.*)
53+
# Capture both plain assignments and shell parameter-expansion defaults.
54+
local_version_regex: (.*QT[0-9_]+VERSION\s*=\s*"?[^0-9]*)(6\.[0-9.]+)(.*)
5555

5656
- name: jack
5757
changelog_name: bundled JACK (Windows-only)

0 commit comments

Comments
 (0)