Update main.yml #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build AppImage | ||
| on: | ||
| push: | ||
| tags: ["v*"] | ||
| workflow_dispatch: | ||
| jobs: | ||
| build-linux: | ||
| runs-on: ubuntu-latest | ||
| container: ubuntu:20.04 # Build inside Ubuntu 20.04 for wide Linux compatibility | ||
| env: | ||
| APP_NAME: LikeTaskManager | ||
| PROJ_FILE: LikeTaskManager.pro | ||
| BUILD_DIR: ${{ github.workspace }}/build | ||
| APPDIR: ${{ github.workspace }}/AppDir | ||
| QT_VERSION: "6.5.3" # Qt6 LTS version compatible with Ubuntu 20.04 | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| - name: Install system dependencies | ||
| run: | | ||
| apt-get update | ||
| DEBIAN_FRONTEND=noninteractive apt-get install -y \ | ||
| build-essential \ | ||
| libgl1-mesa-dev \ | ||
| libx11-xcb-dev \ | ||
| libxcb1 \ | ||
| libxcb-xinerama0 \ | ||
| libxkbcommon-x11-0 \ | ||
| libfontconfig1-dev \ | ||
| libfuse2 \ | ||
| wget \ | ||
| curl \ | ||
| ca-certificates \ | ||
| git | ||
| - name: Install Qt (qmake + tools) | ||
| uses: jurplel/install-qt-action@v4 | ||
| with: | ||
| version: ${{ env.QT_VERSION }} | ||
| target: desktop | ||
| install-deps: 'true' | ||
| cache: 'true' | ||
| - name: Verify qmake | ||
| run: | | ||
| which qmake | ||
| qmake -v | ||
| - name: Build with qmake | ||
| run: | | ||
| set -e | ||
| mkdir -p "$BUILD_DIR" | ||
| cd "$BUILD_DIR" | ||
| qmake "$GITHUB_WORKSPACE/$PROJ_FILE" | ||
| make -j$(nproc) | ||
| - name: Stage install into AppDir | ||
| run: | | ||
| set -e | ||
| mkdir -p "$APPDIR" | ||
| cd "$BUILD_DIR" | ||
| make INSTALL_ROOT="$APPDIR" install | ||
| find "$APPDIR" -maxdepth 3 -print | ||
| - name: Add .desktop file and icon | ||
| run: | | ||
| mkdir -p "$APPDIR/usr/share/applications" | ||
| mkdir -p "$APPDIR/usr/share/icons/hicolor/256x256/apps" | ||
| cat > "$APPDIR/usr/share/applications/$APP_NAME.desktop" <<DESK | ||
| [Desktop Entry] | ||
| Type=Application | ||
| Name=$APP_NAME | ||
| Exec=$APP_NAME | ||
| Icon=liketaskmanager | ||
| Categories=Utility; | ||
| Terminal=false | ||
| DESK | ||
| # Copy icon if it exists | ||
| if [ -f "$GITHUB_WORKSPACE/icons/liketaskmanager-256.png" ]; then | ||
| cp "$GITHUB_WORKSPACE/icons/liketaskmanager-256.png" \ | ||
| "$APPDIR/usr/share/icons/hicolor/256x256/apps/liketaskmanager.png" | ||
| fi | ||
| - name: Download linuxdeploy and Qt plugin | ||
| run: | | ||
| set -e | ||
| LDVER=1-alpha-20250213-2 | ||
| PLUGINQTVER=1-alpha-20250213-1 | ||
| curl -L -o linuxdeploy-x86_64.AppImage \ | ||
| "https://github.com/linuxdeploy/linuxdeploy/releases/download/${LDVER}/linuxdeploy-x86_64.AppImage" | ||
| chmod +x linuxdeploy-x86_64.AppImage | ||
| curl -L -o linuxdeploy-plugin-qt-x86_64.AppImage \ | ||
| "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/${PLUGINQTVER}/linuxdeploy-plugin-qt-x86_64.AppImage" | ||
| chmod +x linuxdeploy-plugin-qt-x86_64.AppImage | ||
| - name: Bundle into AppImage | ||
| env: | ||
| QMAKE: ${{ env.QT_ROOT_DIR }}/bin/qmake | ||
| run: | | ||
| set -e | ||
| EXE_PATH="$APPDIR/usr/bin/$APP_NAME" | ||
| ./linuxdeploy-x86_64.AppImage --appdir "$APPDIR" \ | ||
| --executable "$EXE_PATH" \ | ||
| --desktop-file "$APPDIR/usr/share/applications/$APP_NAME.desktop" \ | ||
| --icon-file "$APPDIR/usr/share/icons/hicolor/256x256/apps/liketaskmanager.png" \ | ||
| --plugin qt \ | ||
| --output appimage | ||
| mkdir -p dist | ||
| mv ./*.AppImage dist/ || true | ||
| ls -l dist | ||
| - name: Upload AppImage artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: $APP_NAME-appimage | ||
| path: dist/*.AppImage | ||