Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions .github/workflows/package-all.yml
Original file line number Diff line number Diff line change
@@ -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
Loading