Skip to content

Commit

Permalink
Try to build on macOS and see what explodes
Browse files Browse the repository at this point in the history
  • Loading branch information
peterix committed May 25, 2023
1 parent fba5cd3 commit 250bb25
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 8 deletions.
83 changes: 79 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX:PATH=../install/Launcher \
-DCMAKE_INSTALL_PREFIX:PATH=../install/DevLauncher \
-DLauncher_VERSION_BUILD="$GITHUB_RUN_NUMBER" \
-DLauncher_BUILD_PLATFORM=lin64 \
-DLauncher_EMBED_SECRETS=Off \
Expand Down Expand Up @@ -55,10 +55,85 @@ jobs:
APP_VERSION: ${{ steps.getversion.outputs.version }}
run: |
cd install
zip -r Launcher-${APP_VERSION}-linux-amd64.zip Launcher
zip -r DevLauncher-${APP_VERSION}-linux-amd64.zip DevLauncher
- name: "Upload Artifacts"
uses: actions/upload-artifact@v2.2.4
with:
name: Launcher-linux-amd64
path: install/Launcher-*.zip
name: DevLauncher-linux-amd64
path: install/DevLauncher-*.zip

build-mac:
name: build-macos-amd64
runs-on: macos-11

steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: "Cache Qt"
id: cache-qt
uses: actions/cache@v1 # not v2!
with:
path: ../Qt
key: ${{ runner.os }}-QtCache

- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
aqtversion: '==3.1.*'
version: '6.5.1'
host: 'mac'
target: 'desktop'
arch: 'clang_64'
modules: 'qt5compat'
cached: ${{ steps.cache-qt.outputs.cache-hit }}

- name: "Configure"
run: |
mkdir -p build
cd build
cmake \
-DCMAKE_C_COMPILER=/usr/bin/clang \
-DCMAKE_CXX_COMPILER=/usr/bin/clang++ \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX:PATH=../install/DevLauncher \
-DLauncher_VERSION_BUILD="$GITHUB_RUN_NUMBER" \
-DLauncher_BUILD_PLATFORM=macos \
-DLauncher_EMBED_SECRETS=Off \
..
# This uses https://docs.github.com/en/actions/learn-github-actions/workflow-commands-for-github-actions#setting-an-output-parameter
# ::set-output name=version::1.2.3.4
- name: "Get Version"
id: getversion
run: |
cd build
make ga_version
- name: "Build"
run: |
cd build
make -j$(sysctl -n hw.logicalcpu)
- name: "Install"
run: |
cd build
make install
- name: "Generate bundle"
run: |
cd install
macdeployqt DevLauncher.app
- name: "Package"
env:
APP_VERSION: ${{ steps.getversion.outputs.version }}
run: ditto -V -c -k --keepParent "install/DevLauncher.app" "install/DevLauncher-${APP_VERSION}-macos.zip"

- name: "Upload Artifacts"
uses: actions/upload-artifact@v2.2.4
with:
name: DevLauncher-macos
path: install/DevLauncher-*.zip
6 changes: 2 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
# See: https://cmake.org/cmake/help/latest/variable/CMAKE_OSX_ARCHITECTURES.html
# See: https://cmake.org/cmake/help/latest/variable/CMAKE_OSX_DEPLOYMENT_TARGET.html
if(APPLE)
# No M1 build with Qt 5
set(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "macOS architecture(s) to build for.")
# Target 10.14 for the improved theming support
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14" CACHE STRING "minimum macOS versions to build for.")
set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE STRING "macOS architecture(s) to build for.")
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0" CACHE STRING "minimum macOS versions to build for.")
endif()

set(CMAKE_CXX_STANDARD_REQUIRED true)
Expand Down

0 comments on commit 250bb25

Please sign in to comment.