-
Notifications
You must be signed in to change notification settings - Fork 67
73 lines (72 loc) · 2.26 KB
/
macos-qt6.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
72
73
name: MacOS Qt6
on:
push:
paths-ignore:
- "README.md"
- "LICENSE"
- "BUILD.md"
pull_request:
paths-ignore:
- "README.md"
- "LICENSE"
- "BUILD.md"
release:
types: [published]
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
build_type: [Release, RelWithDebInfo]
arch: [x86_64, arm64]
qt_ver: [6.5.1]
qt_arch: [clang_64]
env:
targetName: lemon
steps:
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{ matrix.qt_ver }}
cached: ${{ steps.MacosCacheQt.outputs.cache-hit }}
- uses: actions/checkout@v4
with:
submodules: true
- name: macOS - ${{ matrix.qt_version }} - Build preparation - Install Packages
run: |
brew install ninja pkg-config
- name: build macos
run: |
cmake . \
-GNinja \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DLEMON_QT6=ON \
-DLEMON_BUILD_INFO="Build for macOS" \
-DLEMON_BUILD_EXTRA_INFO="Build on $(uname -sr)" \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 \
-DCMAKE_OSX_ARCHITECTURES="${{ matrix.arch }}"
cmake --build . --parallel $(sysctl -n hw.logicalcpu)
# tag 打包
- name: package
env:
Qt6_DIR: ../Qt/${{matrix.qt_ver}}/${{matrix.qt_arch}}
run: |
# 拷贝依赖
#mv ${targetName} ${targetName}.app
export PATH=$Qt6_DIR/bin:$PATH
macdeployqt ${targetName}.app -qmldir=. -verbose=1 -dmg
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.targetName }}-Qt${{ matrix.qt_ver }}-${{ matrix.build_type }}-${{ matrix.arch }}.dmg
path: ${{ env.targetName }}.dmg
- name: uploadRelease
if: startsWith(github.event.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./${{ env.targetName }}.dmg
asset_name: ${{ env.targetName }}-Qt${{ matrix.qt_ver }}-${{ matrix.build_type }}-${{ matrix.arch }}.dmg
tag: ${{ github.ref }}