Skip to content

Commit

Permalink
Autobuild: Install JACK via web request
Browse files Browse the repository at this point in the history
Fixes: #2992
  • Loading branch information
ann0see committed Jan 31, 2023
1 parent 39a47eb commit d445b84
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 13 deletions.
73 changes: 64 additions & 9 deletions .github/autobuild/windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -100,20 +132,43 @@ 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"
echo "Downloading 32 and 64 Bit JACK installer..."

if (-not(Test-Path -Path "$DownloadCacheDir"))
{
New-Item -Path $DownloadCacheDir -ItemType "directory"
}

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"
}

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"
}
}

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/autobuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/bump-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d445b84

Please sign in to comment.