diff --git a/.github/autobuild/windows.ps1 b/.github/autobuild/windows.ps1 index 4af8c27026..74cc0485e5 100644 --- a/.github/autobuild/windows.ps1 +++ b/.github/autobuild/windows.ps1 @@ -16,22 +16,54 @@ $ErrorActionPreference = "Stop" $QtDir = 'C:\Qt' $ChocoCacheDir = 'C:\ChocoCache' +$DownloadCacheDir = 'C:\AutobuildCache' # The following version pinnings are semi-automatically checked for # updates. Verify .github/workflows/bump-dependencies.yaml when changing those manually: $Qt32Version = "5.15.2" $Qt64Version = "5.15.2" $AqtinstallVersion = "3.1.0" -$JackVersion = "1.9.21.20221111" +$JackVersion = "1.9.21" $Msvc32Version = "win32_msvc2019" $Msvc64Version = "win64_msvc2019_64" $JomVersion = "1.1.2" +# Compose JACK download urls +$JackBaseUrl = "https://github.com/jackaudio/jack2-releases/releases/download/v${JackVersion}/jack2-win" +$Jack64Url = $JackBaseUrl + "64-v${JackVersion}.exe" +$Jack32Url = $JackBaseUrl + "32-v${JackVersion}.exe" + $JamulusVersion = $Env:JAMULUS_BUILD_VERSION if ( $JamulusVersion -notmatch '^\d+\.\d+\.\d+.*' ) { throw "Environment variable JAMULUS_BUILD_VERSION has to be set to a valid version string" } +# Download dependency to cache directory +Function Download-Dependency +{ + param( + [Parameter(Mandatory=$true)] + [string] $Uri, + [Parameter(Mandatory=$true)] + [string] $Name + ) + + + # Restore dependency if cached copy already exists + if (Test-Path -Path "$DownloadCacheDir\$Name" -PathType Leaf) + { + echo "Using ${DownloadCacheDir}\${Name} from previous run (actions/cache)" + return + } + + Invoke-WebRequest -Uri $Uri -OutFile "${DownloadCacheDir}\${Name}" + + if ( !$? ) + { + throw "Download of "+ $Name + " (" + $Uri + ") failed with exit code $LastExitCode" + } +} + Function Install-Qt { param( @@ -100,21 +132,52 @@ Function Ensure-JACK return } - echo "Install JACK2 64-bit..." - # Install JACK2 64-bit - choco install --no-progress -y jack --version "${JackVersion}" + # Set installer parameters for silent install + + $JACKInstallParms = "/VERYSILENT", "/SUPPRESSMSGBOXES", "/NORESTART" + + # Create cache directory if it doesn't exist yet + + if (-not(Test-Path -Path "$DownloadCacheDir")) + { + New-Item -Path $DownloadCacheDir -ItemType "directory" + } + + echo "Downloading 64 Bit and 32 Bit JACK installer (if needed)..." + + Download-Dependency -Uri $Jack64Url -Name "JACK64.exe" + Download-Dependency -Uri $Jack32Url -Name "JACK32.exe" + + # Install JACK 64 Bit silently via installer + + echo "Installing JACK2 64-bit..." + + $JACKInstallPath = "${DownloadCacheDir}\JACK64.exe" + + & $JACKInstallPath $JACKInstallParms + if ( !$? ) { - throw "64bit jack installation failed with exit code $LastExitCode" + throw "64bit JACK installer failed with exit code $LastExitCode" + } else { + echo "64bit JACK installation completed successfully" } - echo "Install JACK2 32-bit..." - # Install JACK2 32-bit (need to force choco install as it detects 64 bits as installed) - choco install --no-progress -y -f --forcex86 jack --version "${JackVersion}" + echo "Installing JACK2 32-bit..." + + # Install JACK 32 Bit silently via installer + + $JACKInstallPath = "${DownloadCacheDir}\JACK32.exe" + + & $JACKInstallPath $JACKInstallParms + if ( !$? ) { - throw "32bit jack installation failed with exit code $LastExitCode" + throw "32bit JACK installer failed with exit code $LastExitCode" + } else { + echo "32bit JACK installation completed successfully" } + } Function Build-App-With-Installer diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index 95332917f2..3640bcef1c 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -329,6 +329,7 @@ jobs: path: | C:\Qt C:\ChocoCache + C:\AutobuildCache ${{ github.workspace }}\libs\NSIS\NSIS-source ${{ github.workspace }}\libs\ASIOSDK2 key: ${{ matrix.config.target_os }}-${{ hashFiles('.github/workflows/autobuild.yml', '.github/autobuild/windows.ps1', 'windows/deploy_windows.ps1') }}-${{ matrix.config.base_command }} diff --git a/.github/workflows/bump-dependencies.yml b/.github/workflows/bump-dependencies.yml index bd5e0dc1bf..6efc755b6b 100644 --- a/.github/workflows/bump-dependencies.yml +++ b/.github/workflows/bump-dependencies.yml @@ -50,11 +50,9 @@ jobs: # The following regex captures both the *nix and the Windows variable syntax (different case, underscore): local_version_regex: (.*QT[0-9_]+VERSION\s*=\s*"?)(6\.[0-9.]+)("?.*) - - name: choco-jack + - name: jack changelog_name: bundled JACK (Windows-only) - get_upstream_version: | - curl -s -o /dev/null --location --range 0-5 --write-out '%{url_effective}' https://community.chocolatey.org/api/v2/package/jack/ | - grep -oP '.*/jack\.\K.*(?=\.nupkg)' + get_upstream_version: GH_REPO=jackaudio/jack2-releases gh release view --json tagName --jq .tagName | sed -re 's/^v//' local_version_regex: (.*JackVersion\s*=\s*"?)([0-9.]+)("?.*) - name: choco-jom