From 045167b34efcd96fa8b5d7bb49d839635367ee90 Mon Sep 17 00:00:00 2001 From: Lewis Buckingham Date: Mon, 8 Sep 2025 15:30:09 +1000 Subject: [PATCH] CI: add workflow_dispatch to package-all --- .github/workflows/package-all.yml | 98 +++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 .github/workflows/package-all.yml diff --git a/.github/workflows/package-all.yml b/.github/workflows/package-all.yml new file mode 100644 index 000000000..18816ed92 --- /dev/null +++ b/.github/workflows/package-all.yml @@ -0,0 +1,98 @@ +name: package-all +on: + workflow_dispatch: +jobs: + mac: + strategy: + fail-fast: false + matrix: + os: [macos-13, macos-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: jurplel/install-qt-action@v4 + with: + version: 6.5.3 + cache: true + - uses: seanmiddleditch/gha-setup-ninja@v3 + - name: Configure + run: cmake -S . -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$QT_ROOT_DIR" + - name: Build + run: cmake --build build -j + - name: Locate app bundle + id: app + run: | + APP=$(find build -type d -name "*.app" -print -quit) + echo "APP=$APP" >> $GITHUB_OUTPUT + - name: Deploy Qt frameworks + run: "$QT_ROOT_DIR/bin/macdeployqt" "${{ steps.app.outputs.APP }}" -verbose=2 + - name: Add rpath and ad-hoc sign + run: | + APP="${{ steps.app.outputs.APP }}" + BIN="$APP/Contents/MacOS/$(basename "$APP" .app)" + install_name_tool -add_rpath "@executable_path/../Frameworks" "$BIN" 2>/dev/null || true + codesign --force --deep --sign - "$APP" + - name: Create DMG + run: | + mkdir -p artifact + hdiutil create -fs HFS+ -volname "MMapper" -srcfolder "${{ steps.app.outputs.APP }}" -ov -format UDZO "artifact/MMapper-${{ matrix.os }}.dmg" + - uses: actions/upload-artifact@v4 + with: + name: mmapper-dmg-${{ matrix.os }} + path: artifact/*.dmg + windows: + runs-on: windows-2022 + steps: + - uses: actions/checkout@v4 + - uses: jurplel/install-qt-action@v4 + with: + version: 6.5.3 + cache: true + - uses: seanmiddleditch/gha-setup-ninja@v3 + - name: Configure + shell: pwsh + run: cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$env:QT_ROOT_DIR" + - name: Build + shell: pwsh + run: cmake --build build -j + - name: Find exe + id: exe + shell: pwsh + run: | + $exe = Get-ChildItem -Path build -Recurse -Filter *.exe | Select-Object -First 1 + echo "exe=$($exe.FullName)" >> $env:GITHUB_OUTPUT + - name: Deploy Qt + shell: pwsh + run: & "$env:QT_ROOT_DIR\bin\windeployqt.exe" "${{ steps.exe.outputs.exe }}" + - name: Zip + shell: pwsh + run: | + New-Item -ItemType Directory -Force artifact | Out-Null + $dir = Split-Path -Parent "${{ steps.exe.outputs.exe }}" + Compress-Archive -Path "$dir\*" -DestinationPath "artifact\mmapper-windows.zip" + - uses: actions/upload-artifact@v4 + with: + name: mmapper-windows + path: artifact/mmapper-windows.zip + linux: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: jurplel/install-qt-action@v4 + with: + version: 6.5.3 + cache: true + - name: Install tools + run: sudo apt-get update && sudo apt-get install -y ninja-build + - name: Configure + run: cmake -S . -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$QT_ROOT_DIR" -DCPACK_PACKAGE_DIRECTORY="${{ github.workspace }}/artifact" + - name: Build + run: cmake --build build -j + - name: Package TGZ + run: | + cd build + cpack -G TGZ -D CPACK_COMPONENTS_ALL=applications -D CPACK_STRIP_FILES=ON + - uses: actions/upload-artifact@v4 + with: + name: mmapper-linux + path: artifact/*.tar.gz