-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (62 loc) · 1.98 KB
/
macos-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: macOS build
on:
push:
workflow_dispatch:
inputs:
packageRelease:
description: 'Package binaries for release and upload them'
required: false
default: false
jobs:
macos:
name: macOS desktop (Qt ${{ matrix.qt-version }})
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
qt-version: ['6.2', '6.4']
steps:
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: '${{ matrix.qt-version }}.*'
cache: true
modules: 'qtnetworkauth'
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Build
run: |
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
cmake --build . --config RelWithDebInfo
cd ..
# If Apple didn't insist on bundling apps as folders, this wouldn't be necessary; however, this is done to ensure that the .app folder remains intact
- name: Prepare binary for uploading
run: |
mkdir upload_dir
cd upload_dir
cp -r ../build/TimeLight.app .
cd ..
- name: Upload binary
uses: actions/upload-artifact@v2
with:
name: macOS binary (Qt ${{ matrix.qt-version }})
path: upload_dir
retention-days: 7
- name: Build release package
if: ${{ github.event.inputs.packageRelease || startsWith(github.ref, 'refs/tags/v') }}
run: |
mkdir release_dir
cd release_dir
cp -r ../build/TimeLight.app .
macdeployqt TimeLight.app -dmg
cd ..
- name: Upload release package
if: ${{ github.event.inputs.packageRelease || startsWith(github.ref, 'refs/tags/v') }}
uses: actions/upload-artifact@v2
with:
name: macOS package (64-bit, Qt ${{ matrix.qt-version }})
path: release_dir/TimeLight.dmg
retention-days: 7