Skip to content

Commit

Permalink
Add build for Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
jdpurcell committed Jan 7, 2025
1 parent 7f2d280 commit 26bf0ed
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
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
28 changes: 27 additions & 1 deletion ci/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ qmake DESTDIR="build" $argDeviceArchs

if ($IsWindows) {
nmake
} elseif ($IsMacOS) {
} else {
make
}

Expand All @@ -51,4 +51,30 @@ if ($IsWindows) {
hdiutil convert "temp.sparsebundle" -format ULFO -o "$appName.dmg"
Remove-Item -Recurse "temp.sparsebundle"
Remove-Item -Recurse "$appName.app"
} elseif ($IsLinux) {
sudo apt update
sudo apt install libfuse2

$archName = switch ($env:buildArch) {
'X64' { 'x86_64' }
'Arm64' { 'aarch64' }
default { throw 'Unsupported build architecture.' }
}

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" `
--executable "$appName" `
--create-desktop-file `
--icon-file "$env:GITHUB_WORKSPACE/dist/app-generic.svg" `
--icon-filename "$appName" `
--plugin qt `
--output appimage

Remove-Item -Recurse "AppDir" -Force
Remove-Item $appName
}
1 change: 1 addition & 0 deletions dist/app-generic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 26bf0ed

Please sign in to comment.