Skip to content

Commit

Permalink
Build universal package
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Jan 11, 2025
1 parent 03ed840 commit 2f0c330
Showing 1 changed file with 72 additions and 9 deletions.
81 changes: 72 additions & 9 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ jobs:
-D ENABLE_TESTS=ON \
-D NUGET_USERNAME=opengisch \
-D NUGET_TOKEN=${{ secrets.GITHUB_TOKEN }} \
-D SENTRY_DSN=${{ secrets.SENTRY_DSN }} \
-D SENTRY_ENV="${APP_ENV}" \
-D MACOS_CODE_SIGN_IDENTITY="Apple Development" \
-D CMAKE_CXX_VISIBILITY_PRESET=hidden \
-D CMAKE_OSX_DEPLOYMENT_TARGET=${{ matrix.deployment-target }} \
Expand All @@ -139,20 +141,16 @@ jobs:
cd "${{ env.CMAKE_BUILD_DIR }}"
ctest --output-on-failure -R smoke -C ${{ env.BUILD_TYPE }}
- name: πŸ“¦ Package
env:
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
- name: πŸ“¦ Prepackage
run: |
echo "Killing XProtect..."; sudo pkill -9 XProtect >/dev/null || true; # see https://github.com/actions/runner-images/issues/7522
cmake --build "${{ env.CMAKE_BUILD_DIR }}" --target bundle --config ${{ env.BUILD_TYPE }}
echo "ARTIFACT_PATHNAME=${{ env.CMAKE_BUILD_DIR }}/QField-Installer.dmg" >> $GITHUB_ENV
echo "ARTIFACT_NAME=qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}-${{ matrix.triplet }}.dmg" >> $GITHUB_ENV
cmake --build "${{ env.CMAKE_BUILD_DIR }}" --config ${{ env.BUILD_TYPE }}
DESTDIR=staging cmake --install "${{ env.CMAKE_BUILD_DIR }}" --config ${{ env.BUILD_TYPE }}
- name: πŸ“¦ Upload package
uses: actions/upload-artifact@v4
with:
name: "QField-dev-${{ matrix.triplet }}-experimental-qt6"
path: ${{ env.CMAKE_BUILD_DIR }}/QField-Installer.dmg
name: "qfield-app-${{ matrix.triplet }}"
path: staging

- name: πŸ“Š Upload test report
if: always()
Expand Down Expand Up @@ -187,3 +185,68 @@ jobs:
SENTRY_PROJECT_SLUG: qfield
run: |
bundle exec fastlane run sentry_debug_files_upload path:${{ env.CMAKE_BUILD_DIR }}
schedule_download_comment:
name: Create dmg
runs-on: macos-15
needs: build
steps:
- name: 🐣 Checkout
uses: actions/checkout@v4

- name: πŸ”¨ Prepare build env
run: |
brew install create-dmg
- name: πŸ“€ Download app
uses: actions/download-artifact@v4
with:
pattern: qfield-app-*
path: |
artifacts
- name: Create universal app
run: |
wget https://raw.githubusercontent.com/faaxm/lipo-dir-merge/refs/heads/main/lipo-dir-merge.py
python lipo-dir-merge.py ./artifacts/qfield-app-x64-osx ./artifacts/qfield-app-arm64-osx universal
- name: Create dmg
run: |
create-dmg --volname "QField Installer" \
--hide-extension QField.app \
--volicon "$(pwd)/platform/macos/installer.icns" \
--background "$(pwd)/platform/macos/installer_background.png" \
--window-pos 200 120 \
--window-size 512 320 \
--icon-size 100 \
--icon "QField.app" 130 160 \
--app-drop-link 400 155 \
"QField Installer.dmg" \
universal/*/*.app
- name: πŸ“€ Upload app
uses: actions/upload-artifact@v4
id: artifact-mac-qt6
with:
name: qgis-${{steps.workflow-artifact-ids.outputs.display-name}}-dmg
path: |
*.dmg
- name: Upload release assets
uses: AButler/upload-release-assets@v3.0
if: ${{ github.event_name == 'release' }}
with:
files: '*.dmg'
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Schedule download comment
uses: ./.github/actions/post_sticky_comment
if: github.event_name == 'pull_request'
with:
marker: macos-qt6
body: |
### 🍎 MacOS Qt6 builds
Download [MacOS Qt6 builds of this PR for testing](${{ steps.artifact-mac-qt6.outputs.artifact-url }}).
_This installer is not signed, `control`+click > `open` the app to avoid the warning_
*(Built from commit ${{ github.event.pull_request.head.sha }})*
pr: ${{ github.event.number }}

0 comments on commit 2f0c330

Please sign in to comment.