Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
jdpurcell committed Jan 7, 2025
1 parent 5e7ed70 commit 3481224
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
41 changes: 27 additions & 14 deletions ci/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
}

Expand All @@ -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"
}

0 comments on commit 3481224

Please sign in to comment.