forked from NJUPT-SAST-Cpp/sast-music
-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (71 loc) · 2.21 KB
/
macos.yaml
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
74
75
76
77
78
79
80
81
name: macOS
on:
push:
paths:
- "*.txt"
- "src/**"
- "!**.qml"
- "!**.md"
- "!**.cmake"
- ".github/**"
pull_request:
paths:
- "src/**"
- "!**.qml"
- "!**.md"
- "!**.cmake"
workflow_dispatch:
permissions: write-all
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
qt_ver: [6.6.1]
qt_arch: [clang_64]
env:
targetName: sast-music
QT_MODULES: "qt5compat qthttpserver qtshadertools qtmultimedia"
steps:
- name: check out repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: set up Ninja
uses: seanmiddleditch/gha-setup-ninja@v3
with:
version: 1.10.2
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{ matrix.qt_ver }}
cache: ${{ steps.cache-qt.outputs.cache-hit }}
arch: ${{ matrix.qt_arch }}
modules: ${{ env.QT_MODULES }}
- name: build macos
run: |
cmake --version
mkdir build
cd build
cmake -DCMAKE_MESSAGE_LOG_LEVEL=STATUS -DCMAKE_PREFIX_PATH=${{env.Qt6_DIR}} -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -GNinja ..
cmake --build . --target all --config Release --parallel
- name: pakage
if: startsWith(github.event.ref, 'refs/tags/')
run: |
sudo find /Users/runner/work/sast-music/Qt/6.6.1/macos/qml -name "*.dSYM" | xargs rm -r
sudo macdeployqt bin/release/sast_music.app -qmldir=. -verbose=1 -dmg
- uses: actions/upload-artifact@v2
if: startsWith(github.event.ref, 'refs/tags/')
with:
name: ${{ env.targetName }}_${{ matrix.os }}
path: bin/release/sast_music.app
- name: upload release
if: startsWith(github.event.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: bin/release/sast_music.dmg
asset_name: ${{ env.targetName }}_macOS.dmg
tag: ${{ github.ref }}
overwrite: true