Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🍎 Mac Qt6 .dmg #60039

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
06f7e16
Remove QGIS_MACAPP_FRAMEWORK
m-kuhn Jan 2, 2025
5fbd134
New app layout
m-kuhn Jan 2, 2025
9189771
Disable mac packager workflow
m-kuhn Jan 2, 2025
2fb09cd
Mac vcpkg workflow
m-kuhn Jan 2, 2025
89b7c1b
Bump py-tomli
m-kuhn Jan 2, 2025
9d2a7be
Improve workflows
m-kuhn Jan 2, 2025
2e6217b
Fix CPACK_PACKAGING_INSTALL_PREFIX for macos
m-kuhn Jan 2, 2025
32be603
Fix packaging install prefix
m-kuhn Jan 2, 2025
359be2d
Store build cache
m-kuhn Jan 2, 2025
b4b0853
Fix download link for x64 dmg
m-kuhn Jan 2, 2025
ac9c175
Externalize dmg building
m-kuhn Jan 3, 2025
bab8da9
Fix path
m-kuhn Jan 3, 2025
1bfb698
Fix bundle paths
m-kuhn Jan 4, 2025
96c7bf7
Make the app name configurable
m-kuhn Jan 4, 2025
01cd5b2
Remove leftover install
m-kuhn Jan 4, 2025
87fd41c
Upload dmg
m-kuhn Jan 4, 2025
c56d3e7
Handle symlinks in lipo-dir-merge
m-kuhn Jan 5, 2025
302d699
Switch to a python based macdeployqt'
m-kuhn Jan 6, 2025
c426d07
Update installer image
m-kuhn Jan 6, 2025
f915af9
Preserve symlinks via tar
m-kuhn Jan 7, 2025
a22b327
Ignore spellcheck
m-kuhn Jan 7, 2025
3ab45e2
Fix postgresql version
m-kuhn Jan 8, 2025
1d0c6f1
Fix qca plugins
m-kuhn Jan 8, 2025
2ea5928
Fix processing gdal algs
m-kuhn Jan 8, 2025
aa3b988
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 8, 2025
4b4cc92
Add app icons for macOS with Apple standards
alexkolodko Dec 5, 2024
10a6e24
Specify dark mode icon
m-kuhn Jan 8, 2025
5206631
Make qca softstore optional
m-kuhn Jan 9, 2025
a0890df
Fix auth on win/vcpkg
m-kuhn Jan 9, 2025
f06bb30
Ship QtQuickWidgets and fix PyQt6.QtQuickWidgets
m-kuhn Jan 10, 2025
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
34 changes: 34 additions & 0 deletions .github/actions/get-workflow-artifact-ids/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: 'Get Workflow Artifact IDs'
description: 'Generates consistent artifact IDs and names based on workflow trigger'

outputs:
filename:
description: 'Filename to use for artifacts (e.g. pr123)'
value: ${{ steps.generate-ids.outputs.filename }}
display-name:
description: 'Human readable name (e.g. PR123)'
value: ${{ steps.generate-ids.outputs.display_name }}

runs:
using: "composite"
steps:
- id: generate-ids
shell: bash
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
ID="pr${{ github.event.pull_request.number }}"
DISPLAY_ID="PR${{ github.event.pull_request.number }}"
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
TAG=${GITHUB_REF#refs/tags/}
ID="$TAG"
DISPLAY_ID="$TAG"
else
SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-7)
BRANCH_NAME=${GITHUB_REF#refs/heads/}
ID="$BRANCH_NAME-$SHORT_SHA"
DISPLAY_ID="$BRANCH_NAME build $SHORT_SHA"
fi
# Set outputs
echo "filename=$ID" >> $GITHUB_OUTPUT
echo "display_name=$DISPLAY_ID" >> $GITHUB_OUTPUT
136 changes: 123 additions & 13 deletions .github/workflows/build-macos-qt6.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
---
name: 🍎 Build - MacOS Qt6
on:
# push:
# branches:
# - main
# pull_request:
# release:
# types: ['published']
push:
branches:
- master
- release-*
pull_request:
release:
types: ['published']
workflow_dispatch:

concurrency:
Expand All @@ -18,9 +19,9 @@ jobs:
strategy:
matrix:
include:
# - os: macos-13
# triplet: x64-osx
# deployment-target: "10.15"
- os: macos-13
triplet: x64-osx-dynamic-release
deployment-target: "10.15"
- os: macos-14
triplet: arm64-osx-dynamic-release
deployment-target: "11.0"
Expand All @@ -42,9 +43,13 @@ jobs:
id: setup-vcpkg
uses: ./.github/actions/setup-vcpkg

- name: 🎲 Get artifact ids
id: workflow-artifact-ids
uses: ./.github/actions/get-workflow-artifact-ids

- name: 🔨 Prepare build env
run: |
brew install automake bison flex gnu-sed create-dmg autoconf-archive nasm libtool fdupes
brew install automake bison flex gnu-sed autoconf-archive nasm libtool fdupes
echo $(brew --prefix bison)/bin >> $GITHUB_PATH
echo $(brew --prefix flex)/bin >> $GITHUB_PATH
echo $(brew --prefix libtool)/bin >> $GITHUB_PATH
Expand All @@ -58,6 +63,19 @@ jobs:
with:
xcode-version: latest-stable

- name: 🛍️ Setup ccache
uses: hendrikmuhs/[email protected]
with:
max-size: 500M
key: build-ccache-win64-qt6-${{ github.event.pull_request.base.ref || github.ref_name }}
# save: ${{ github.event_name == 'push' }}

- name: 🛍️ Tune ccache configuration
shell: bash
run: |
# To make ccache work properly with precompiled headers
ccache --set-config sloppiness=pch_defines,time_macros,include_file_mtime,include_file_ctime

- name: 🌱 Install dependencies and generate project files
run: |
echo "VCPKG_ROOT: ${VCPKG_ROOT}"
Expand All @@ -67,18 +85,20 @@ jobs:
cmake -S . \
-G Ninja \
-B build \
-D QGIS_APP_NAME="QGIS-${{steps.workflow-artifact-ids.outputs.display-name}}" \
-D WITH_VCPKG=ON \
-D BUILD_WITH_QT6=ON \
-D WITH_QTWEBKIT=OFF \
-D WITH_BINDINGS=ON \
-D QGIS_MACAPP_FRAMEWORK=OFF \
-D VCPKG_TARGET_TRIPLET="${{ matrix.triplet }}" \
-D VCPKG_HOST_TRIPLET="${{ matrix.triplet }}" \
-D VCPKG_INSTALL_OPTIONS="--only-binarycaching" \
-D ENABLE_UNITY_BUILDS=ON \
-D NUGET_USERNAME=${{ github.actor }} \
-D NUGET_SOURCE="https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" \
-D NUGET_TOKEN=${{ secrets.GITHUB_TOKEN }} || true

fdupes -r -1 build/vcpkg_installed/arm64-osx-dynamic/lib | grep libQt | while read line; do master=""; for file in ${line[*]}; do if [[ "x${master}" == "x" ]]; then master=$file; else rm "${file}"; ln -s $(basename "${master}") "${file}"; fi; done; done
fdupes -q -r -1 build/vcpkg_installed/${{ matrix.triplet }}/lib | grep libQt | while read line; do master=""; for file in ${line[*]}; do if [[ "x${master}" == "x" ]]; then master=$file; else rm "${file}"; ln -s $(basename "${master}") "${file}"; fi; done; done

cmake -D VCPKG_INSTALL_OPTIONS="" build

Expand All @@ -99,10 +119,100 @@ jobs:
if: github.event_name == 'workflow_dispatch' || github.event_name == 'release'
uses: actions/upload-artifact@v4
with:
name: kadas-albireo2-sdk-${{ matrix.triplet }}
name: qgis-sdk-${{ matrix.triplet }}
path: |
sdk/vcpkg-export-*.zip

- name: 🌋 Build
run: |
# We make sure the target "all" is built before bundling
# Ideally, we would specify each target that is required to be installed, but this workaround is sufficient for now
cmake --build build
cmake --build build --target bundle

- name: Archive app
run: |
gtar -cpvzf qgis-app-${{steps.workflow-artifact-ids.outputs.display-name}}-${{ matrix.triplet }}.tar.gz ./build/_CPack_Packages/Darwin/External/*/*.app

- name: 📤 Upload app
uses: actions/upload-artifact@v4
with:
name: qgis-app-${{steps.workflow-artifact-ids.outputs.display-name}}-${{ matrix.triplet }}
path: |
qgis-app-${{steps.workflow-artifact-ids.outputs.display-name}}-${{ matrix.triplet }}.tar.gz

schedule_download_comment:
name: Create dmg
runs-on: macos-latest
needs: build
steps:
- name: 🐣 Checkout
uses: actions/checkout@v4

- name: 🔨 Prepare build env
run: |
brew install create-dmg


- name: 🎲 Get artifact ids
id: workflow-artifact-ids
uses: ./.github/actions/get-workflow-artifact-ids

- name: 📤 Download app
uses: actions/download-artifact@v4
with:
pattern: qgis-app-${{steps.workflow-artifact-ids.outputs.display-name}}-*
path: |
artifacts

- name: Create universal app
run: |
mkdir -p x64
gtar --strip-components=5 -zxf ./artifacts/qgis-app-${{steps.workflow-artifact-ids.outputs.display-name}}-x64-osx-dynamic-release/qgis-app-${{steps.workflow-artifact-ids.outputs.display-name}}-x64-osx-dynamic-release.tar.gz -C x64
mkdir -p arm64
gtar --strip-components=5 -zxf ./artifacts/qgis-app-${{steps.workflow-artifact-ids.outputs.display-name}}-arm64-osx-dynamic-release/qgis-app-${{steps.workflow-artifact-ids.outputs.display-name}}-arm64-osx-dynamic-release.tar.gz -C arm64

wget https://raw.githubusercontent.com/m-kuhn/lipo-dir-merge/refs/heads/main/lipo-dir-merge.py
python lipo-dir-merge.py x64 arm64 universal

- name: Create dmg
run: |
QGIS_APP_NAME=QGIS-"${{steps.workflow-artifact-ids.outputs.display-name}}"
create-dmg --volname "${QGIS_APP_NAME} Installer" \
--hide-extension ${QGIS_APP_NAME}.app \
--volicon "$(pwd)/images/icons/mac/qgis.icns" \
--background "$(pwd)/platform/macos/installer_background.png" \
--window-pos 200 120 \
--window-size 512 320 \
--icon-size 100 \
--icon "${QGIS_APP_NAME}.app" 130 160 \
--app-drop-link 400 155 \
${QGIS_APP_NAME}-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/[email protected]
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 }}
140 changes: 0 additions & 140 deletions .github/workflows/macos-build.yml

This file was deleted.

Loading
Loading