This repository was archived by the owner on Apr 30, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
169 lines (143 loc) · 6.66 KB
/
Copy pathmacos.yml
File metadata and controls
169 lines (143 loc) · 6.66 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name: "Build xPilot for macOS"
on:
workflow_call:
workflow_dispatch:
env:
MIN_OS_VERSION: 11.0
BUILD_TYPE: Release
VATSIM_CLIENT_ID: ${{ secrets.VATSIM_CLIENT_ID }}
VATSIM_CLIENT_KEY: ${{ secrets.VATSIM_CLIENT_KEY }}
VATSIM_TOWERVIEW_CLIENT_ID: ${{ secrets.VATSIM_TOWERVIEW_CLIENT_ID }}
CONFIG_ENCRYPTION_KEY: ${{ secrets.CONFIG_ENCRYPTION_KEY }}
CLIENT_DIR: ${{ github.workspace }}/client
PLUGIN_DIR: ${{ github.workspace }}/plugin
IB_URL: https://releases.installbuilder.com/installbuilder/installbuilder-enterprise-24.3.0-osx-installer.dmg
IB_LICENSE: ${{ secrets.INSTALLBUILDER_LICENSE }}
QT_VERSION: "v6.5.2"
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Delete dummy auth library
shell: bash
run: rm -rf dependencies/vatsim-auth
- name: Checkout auth library
uses: actions/checkout@v3
with:
repository: xpilot-project/vatsim-auth
path: dependencies/vatsim-auth
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- name: Load developer certificate
env:
CERTIFICATE: ${{ secrets.APPLE_SIGNING_CERTIFICATE }}
CERTIFICATE_PASSWORD: ${{ secrets.APPLE_SIGNING_CERTIFICATE_PASSWORD }}
run: ./scripts/make_keychain.sh
### Buid Plugin ###
- name: Build plugin
working-directory: ${{ env.PLUGIN_DIR }}
run: |
mkdir build && cd build
cmake .. -DCMAKE_OSX_DEPLOYMENT_TARGET=${{ env.MIN_OS_VERSION }} && cmake --build . --config ${{ env.BUILD_TYPE }}
- name: Extract debug symbols
working-directory: ${{ env.PLUGIN_DIR }}/build/mac_x64
run: |
dsymutil xPilot.xpl -o xPilot.dSYM
- name: Package plugin
run: |
mkdir -p ${{ github.workspace }}/xPilot/mac_x64
cp ${{ env.PLUGIN_DIR }}/build/mac_x64/xPilot.xpl ${{ github.workspace }}/xPilot/mac_x64
cp -R ${{ env.PLUGIN_DIR }}/build/mac_x64/xPilot.dSYM ${{ github.workspace }}/xPilot/mac_x64
cp ${{ env.PLUGIN_DIR }}/3rdparty/fmod/libfmod.dylib ${{ github.workspace }}/xPilot/mac_x64
cp -R ${{ env.PLUGIN_DIR }}/Resources ${{ github.workspace }}/xPilot/
- name: Fix FMOD rpath
working-directory: ${{ github.workspace }}/xPilot/mac_x64
run: |
install_name_tool -id @executable_path/../../../Resources/plugins/xPilot/mac_x64/libfmod.dylib libfmod.dylib
install_name_tool -change @rpath/libfmod.dylib @executable_path/../../../Resources/plugins/xPilot/mac_x64/libfmod.dylib xPilot.xpl
### Build Client ###
- name: Download Qt
uses: robinraju/release-downloader@v1.6
with:
repository: "xpilot-project/qt6"
tag: ${{ env.QT_VERSION }}
fileName: "macos.7z"
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- name: Setup Qt
run: |
7z x -oqt6 macos.7z
echo "Qt6_DIR=$(pwd)/qt6" >> $GITHUB_ENV
echo "QT_PLUGIN_PATH=$(pwd)/qt6/plugins" >> $GITHUB_ENV
echo "QML2_IMPORT_PATH=$(pwd)/qt6/qml" >> $GITHUB_ENV
echo "$(pwd)/qt6/bin" >> $GITHUB_PATH
chmod -R +x qt6
- name: Build client
working-directory: ${{ env.CLIENT_DIR }}
run: |
mkdir build && cd build
cmake .. \
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
-DVATSIM_CLIENT_ID=${{ env.VATSIM_CLIENT_ID }} \
-DVATSIM_CLIENT_KEY=${{ env.VATSIM_CLIENT_KEY }} \
-DVATSIM_TOWERVIEW_CLIENT_ID=${{ env.VATSIM_TOWERVIEW_CLIENT_ID }} \
-DCONFIG_ENCRYPTION_KEY=${{ env.CONFIG_ENCRYPTION_KEY }} \
-DCMAKE_PREFIX_PATH=${{ env.Qt6_DIR }} \
-DOPENSSL_ROOT_DIR=${{ github.workspace }}/dependencies/platform/macos/openssl \
-DCMAKE_OSX_DEPLOYMENT_TARGET=${{ env.MIN_OS_VERSION }}
cmake --build . --config ${{ env.BUILD_TYPE }}
- name: Code sign application
working-directory: ${{ env.CLIENT_DIR }}/build
run: |
codesign --force --options runtime --timestamp --sign "${{ secrets.APPLE_SIGNING_CERTIFICATE_IDENTITY }}" --entitlements ../entitlements.plist xPilot.app
- name: Get version
shell: bash
run: |
echo "XPILOT_VERSION=$(cat xpilot.json | jq -r 'if .is_beta == true then "\(.version.major).\(.version.minor).\(.version.patch)-beta.\(.beta_number)" else "\(.version.major).\(.version.minor).\(.version.patch)" end')" >> $GITHUB_ENV
- name: Setup InstallBuilder
shell: bash
run: |
curl -k -L ${{ env.IB_URL }} --output ib.dmg
hdiutil attach ib.dmg
/Volumes/InstallBuilder\ Enterprise/*.app/Contents/MacOS/installbuilder.sh --mode unattended --prefix ../ib
../ib/bin/builder --version
echo "$IB_LICENSE" > lic.xml
echo "CLIENT_BUILD_DIR=${{ env.CLIENT_DIR }}/build" >> $GITHUB_ENV
echo "PLUGIN_BUILD_DIR=${{ github.workspace }}/xPilot" >> $GITHUB_ENV
- name: Create installer
shell: bash
run: |
../ib/bin/builder build installer/macos.xml \
--license lic.xml \
--setvars project.outputDirectory=$(pwd) \
--setvars project.version=${{ env.XPILOT_VERSION }} \
--setvars apple_signing_identity=${{ secrets.APPLE_SIGNING_CERTIFICATE_IDENTITY }} \
--setvars password=${{ secrets.APPLE_SIGNING_CERTIFICATE_PASSWORD }}
- name: Notarize installer
shell: bash
run: xcrun notarytool submit xPilot.dmg --apple-id "${{ secrets.NOTARIZATION_USERNAME }}" --password "${{ secrets.NOTARIZATION_PASSWORD }}" --team-id "${{ secrets.APPLE_TEAM_ID }}"
- name: Rename dmg
run: |
mv xPilot.dmg xPilot-${{ env.XPILOT_VERSION }}-MacOS.dmg
- name: Upload installer artifact
uses: actions/upload-artifact@v4
with:
name: xPilot-${{ env.XPILOT_VERSION }}-MacOS.zip
path: |
xPilot-${{ env.XPILOT_VERSION }}-MacOS.dmg
- name: Create artifacts archive
run: |
mkdir -p macos/plugin
cp -R ${{ github.workspace }}/xPilot macos/plugin/
cp -R ${{ env.CLIENT_DIR }}/build/xPilot.app macos/xPilot.app
cd macos
zip -r ../macOS.zip plugin xPilot.app
- name: Notarize artifacts archive
run: |
xcrun notarytool submit macOS.zip --apple-id "${{ secrets.NOTARIZATION_USERNAME }}" --password "${{ secrets.NOTARIZATION_PASSWORD }}" --team-id "${{ secrets.APPLE_TEAM_ID }}"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: macOS.zip
path: ${{ github.workspace }}/macOS.zip