-
-
Notifications
You must be signed in to change notification settings - Fork 42
131 lines (110 loc) · 4.53 KB
/
Copy pathbuild-macos.yml
File metadata and controls
131 lines (110 loc) · 4.53 KB
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Build macOS
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
workflow_call:
jobs:
build:
name: arm64
runs-on: macos-15
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Cache Homebrew downloads
uses: actions/cache@v6
with:
path: ~/Library/Caches/Homebrew
key: brew-qt-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/workflows/macos.yml') }}
restore-keys: brew-qt-${{ runner.os }}-${{ runner.arch }}-
- name: Install dependencies
env:
HOMEBREW_NO_AUTO_UPDATE: "1"
HOMEBREW_NO_INSTALL_CLEANUP: "1"
run: brew install qt
- name: Build dependencies
run: cmake -P external/build_deps.cmake
- name: Configure
run: cmake -B build -DCMAKE_BUILD_TYPE=Release
- name: Build
run: cmake --build build
- name: Run tests
run: ctest --test-dir build --output-on-failure
- name: Upload libxdf artifact
uses: actions/upload-artifact@v7
with:
name: libxdf-macos-arm64
path: |
external/lib/libxdf.a
external/include/xdf.h
- name: Upload libbiosig artifact
uses: actions/upload-artifact@v7
with:
name: libbiosig-macos-arm64
path: |
external/lib/libbiosig.a
external/include/biosig.h
external/include/biosig-dev.h
external/include/biosig-network.h
external/include/biosig2.h
external/include/gdftime.h
external/include/mdc_ecg_codes.h
external/include/physicalunits.h
- name: Extract version
run: |
VERSION=$(sed -nE 's/^[[:space:]]*VERSION[[:space:]]+([0-9][0-9.]*)[[:space:]]*$/\1/p' CMakeLists.txt | head -1)
echo "APP_VERSION=$VERSION" >> "$GITHUB_ENV"
- name: Import Developer ID certificate
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
env:
MACOS_CERT_P12_BASE64: ${{ secrets.MACOS_CERT_P12_BASE64 }}
MACOS_CERT_PASSWORD: ${{ secrets.MACOS_CERT_PASSWORD }}
run: |
echo "$MACOS_CERT_P12_BASE64" | base64 --decode > certificate.p12
security create-keychain -p "" build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p "" build.keychain
security import certificate.p12 -k build.keychain -P "$MACOS_CERT_PASSWORD" -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple: -s -k "" build.keychain
- name: Deploy Qt frameworks
run: $(brew --prefix qt)/bin/macdeployqt build/SigViewer.app
- name: Sign .app bundle
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
run: 'codesign --deep --force --options runtime --sign "Developer ID Application: CLEMENS BRUNNER (9UC2D22DW3)" build/SigViewer.app'
- name: Notarize .app bundle
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
env:
AC_USERNAME: ${{ secrets.AC_USERNAME }}
AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
run: |
ditto -c -k --sequesterRsrc --keepParent build/SigViewer.app build/SigViewer.zip
xcrun notarytool submit build/SigViewer.zip \
--apple-id "$AC_USERNAME" \
--password "$AC_PASSWORD" \
--team-id 9UC2D22DW3 \
--wait
- name: Staple .app bundle
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
run: xcrun stapler staple build/SigViewer.app
- name: Create DMG
run: |
brew install create-dmg
mkdir dmg_staging
ditto build/SigViewer.app dmg_staging/SigViewer.app
create-dmg \
--volname "SigViewer" \
--window-pos 200 120 \
--window-size 540 380 \
--icon-size 128 \
--icon "SigViewer.app" 135 190 \
--hide-extension "SigViewer.app" \
--app-drop-link 405 190 \
--background "deploy/macos/background.png" \
"build/SigViewer-${{ env.APP_VERSION }}.dmg" \
"dmg_staging/"
- name: Upload SigViewer artifact
uses: actions/upload-artifact@v7
with:
name: sigviewer-macos-arm64
path: build/SigViewer-${{ env.APP_VERSION }}.dmg