From 348122492fb30a4a0095d2633211b65955832d68 Mon Sep 17 00:00:00 2001 From: "J.D. Purcell" Date: Tue, 7 Jan 2025 00:00:00 -0500 Subject: [PATCH] WIP --- .github/workflows/build.yml | 3 +++ ci/build.ps1 | 41 ++++++++++++++++++++++++------------- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a37919b..1ad8919 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,6 +18,9 @@ jobs: buildArch: 'Arm64' qtVersion: '6.8.1' qtArch: 'win64_msvc2022_arm64_cross_compiled' + - runner: 'ubuntu-22.04' + buildArch: 'X64' + qtVersion: '6.8.1' runs-on: ${{ matrix.runner }} steps: - name: Checkout diff --git a/ci/build.ps1 b/ci/build.ps1 index 92722df..d4d0a84 100644 --- a/ci/build.ps1 +++ b/ci/build.ps1 @@ -6,12 +6,10 @@ if ($IsWindows) { $env:QT_HOST_PATH = (qmake -query QT_HOST_PREFIX) } - $argArch = - $env:buildArch -eq 'X64' ? 'x64' : - $env:buildArch -eq 'Arm64' ? 'x64_arm64' : - $null - if (-not $argArch) { - throw 'Unsupported build architecture.' + $argArch = switch ($env:buildArch) { + 'X64' { 'x64' } + 'Arm64' { 'x64_arm64' } + default { throw 'Unsupported build architecture.' } } $vsDir = vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath cmd /c "`"$(Join-Path $vsDir 'VC\Auxiliary\Build\vcvarsall.bat')`" $argArch > null && set" | ForEach-Object { @@ -21,20 +19,18 @@ if ($IsWindows) { } if ($IsMacOS) { - $argDeviceArchs = - $env:buildArch -eq 'X64' ? 'QMAKE_APPLE_DEVICE_ARCHS=x86_64' : - $env:buildArch -eq 'Arm64' ? 'QMAKE_APPLE_DEVICE_ARCHS=arm64' : - $env:buildArch -eq 'Universal' ? 'QMAKE_APPLE_DEVICE_ARCHS=x86_64 arm64' : - $null - if (-not $argDeviceArchs) { - throw 'Unsupported build architecture.' + $argDeviceArchs = switch ($env:buildArch) { + 'X64' { 'QMAKE_APPLE_DEVICE_ARCHS=x86_64' } + 'Arm64' { 'QMAKE_APPLE_DEVICE_ARCHS=arm64' } + 'Universal' { 'QMAKE_APPLE_DEVICE_ARCHS=x86_64 arm64' } + default { throw 'Unsupported build architecture.' } } } qmake DESTDIR="build" $argDeviceArchs if ($IsWindows) { nmake -} elseif ($IsMacOS) { +} else { make } @@ -58,4 +54,21 @@ if ($IsWindows) { hdiutil convert "temp.sparsebundle" -format ULFO -o "$appName.dmg" Remove-Item -Recurse "temp.sparsebundle" Remove-Item -Recurse "$appName.app" +} elseif ($IsLinux) { + $archName = switch ($env:buildArch) { + 'X64' { 'x86_64' } + default { throw 'Unsupported build architecture.' } + } + + New-Item -ItemType Directory -Name "AppDir" + Get-ChildItem -Exclude "AppDir" | Move-Item -Destination "AppDir" + + Invoke-WebRequest -Uri "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-$archName.AppImage" -OutFile "../linuxdeploy-$archName.AppImage" + Invoke-WebRequest -Uri "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-$archName.AppImage" -OutFile "../linuxdeploy-plugin-qt-$archName.AppImage" + chmod +x "../linuxdeploy-$archName.AppImage" + chmod +x "../linuxdeploy-plugin-qt-$archName.AppImage" + + & "../linuxdeploy-$archName.AppImage" --appdir "AppDir" --plugin qt --output appimage + + Remove-Item -Recurse "AppDir" }