From da13e12e8efcd90f0cb764ba685fa6c8d87fb19d Mon Sep 17 00:00:00 2001 From: Gary Wang Date: Sat, 17 Aug 2024 23:11:12 +0800 Subject: [PATCH] CI: linux AppImage build --- .github/FUNDING.yml | 1 + .github/workflows/linux.yml | 42 +++++++++++++++++++ ...et.blumia.pineapple-tracker-player.desktop | 2 +- quick/CMakeLists.txt | 2 +- widget/mainwindow.cpp | 1 + 5 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 .github/FUNDING.yml create mode 100644 .github/workflows/linux.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..fc16bd9 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +ko_fi: blumia diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 0000000..65449f5 --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,42 @@ +name: Linux Package + +on: [push, pull_request, workflow_dispatch] + +jobs: + build: + runs-on: ubuntu-24.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + - name: Install build dept. + run: | + sudo apt update + sudo apt install cmake qt6-base-dev qt6-tools-dev qt6-declarative-dev portaudio19-dev libopenmpt-dev + # for linuxdeploy: https://github.com/AppImage/AppImageKit/wiki/FUSE + # linuxdeploy-plugin-qt still requires qmake currently: https://github.com/linuxdeploy/linuxdeploy-plugin-qt/issues/156 + sudo add-apt-repository universe + sudo apt install libfuse2 qmake6 + - name: Get linuxdeploy + run: | + wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage + wget https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage + chmod +x linuxdeploy-*.AppImage + - name: Build + working-directory: ./ + run: | + cmake -B build . + cmake --build build -j + - name: Package + env: + QMAKE: /usr/bin/qmake6 + run: | + ./linuxdeploy-x86_64.AppImage --appdir AppDir -e build/quick/pineapple-tracker-player-quick -d dist/net.blumia.pineapple-tracker-player.desktop -i dist/pineapple-tracker-player.svg --icon-filename net.blumia.pineapple-tracker-player -p qt -o appimage + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: Linux-Build + path: | + "*.AppImage" + "!linuxdeploy*.AppImage" diff --git a/dist/net.blumia.pineapple-tracker-player.desktop b/dist/net.blumia.pineapple-tracker-player.desktop index 8ba273d..fc43a9e 100644 --- a/dist/net.blumia.pineapple-tracker-player.desktop +++ b/dist/net.blumia.pineapple-tracker-player.desktop @@ -5,7 +5,7 @@ Comment[zh_CN]=菠萝トラッカー播放器是一个模块音乐播放器 Exec=env QT_QUICK_CONTROLS_MATERIAL_THEME=Dark pineapple-tracker-player-quick -style Material %F GenericName=Modular Music Player GenericName[zh_CN]=模块音乐播放器 -Icon=pineapple-tracker-player +Icon=net.blumia.pineapple-tracker-player Keywords=OpenMPT;XM; MimeType=audio/x-xm;audio/x-mod;audio/x-it;audio/x-s3m; Name=Pineapple Tracker Player diff --git a/quick/CMakeLists.txt b/quick/CMakeLists.txt index be8135f..0ea6cc4 100644 --- a/quick/CMakeLists.txt +++ b/quick/CMakeLists.txt @@ -86,7 +86,7 @@ install(TARGETS pineapple-tracker-player-quick install ( FILES ../dist/pineapple-tracker-player.svg DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps" - RENAME pineapple-tracker-player.svg + RENAME net.blumia.pineapple-tracker-player.svg ) # install shortcut diff --git a/widget/mainwindow.cpp b/widget/mainwindow.cpp index eedf305..3bd7b0f 100644 --- a/widget/mainwindow.cpp +++ b/widget/mainwindow.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include