-
Notifications
You must be signed in to change notification settings - Fork 0
163 lines (136 loc) · 6.11 KB
/
juce_ci.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
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
name: CMake
on: [push]
env:
BUILD_TYPE: Release
OM_BUNDLE_ID: com.mach1.spatial.orientationmanager
OC_BUNDLE_ID: com.mach1.orientation.osc
JUCE_VERSION: 7.0.5
CMAKE_VERSION: 3.21.x
VERSION: 1.0.0
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-2016]
steps:
- name: Setup cmake
uses: jwlawson/[email protected]
with:
cmake-version: 3.21.x
- name: Test cmake
run: cmake --version
- uses: actions/checkout@v3
with:
submodules: recursive
- name: OM Submodule JUCE
uses: actions/checkout@v3
with:
repository: juce-framework/JUCE
path: JUCE
ref: 7.0.5
- name: OM Configure (macos)
if: runner.os == 'MacOS'
shell: bash
run: cmake -Bbuild -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DM1_ORIENTATION_MANAGER_EMBEDDED=1
- name: OM Configure (windows)
if: runner.os == 'Windows'
shell: bash
run: cmake -Bbuild -A x64 -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DM1_ORIENTATION_MANAGER_EMBEDDED=1
- name: OM Build
shell: bash
run: cmake --build build --config $BUILD_TYPE
# - name: 'OM Upload Artifact (macos)'
# if: runner.os == 'MacOS'
# working-directory: ${{runner.workspace}}
# uses: actions/upload-artifact@v2
# with:
# name: m1-orientationmanager (MacOS)
# path: build/m1-orientationmanager_artefacts/Release/m1-orientationmanager
# if-no-files-found: error
# - name: 'OM Upload Artifact (windows)'
# if: runner.os == 'Windows'
# uses: actions/upload-artifact@v2
# with:
# name: m1-orientationmanager (Windows)
# path: ${{runner.workspace}}\build\m1-orientationmanager_artefacts\Release\m1-orientationmanager.exe
# if-no-files-found: error
# --- OSC CLIENT APP ---
- name: OC Configure (macos)
if: runner.os == 'MacOS'
shell: bash
working-directory: osc_client
run: cmake -Bbuild -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DM1_ORIENTATION_MANAGER_EMBEDDED=1
- name: OC Configure (windows)
if: runner.os == 'Windows'
shell: bash
working-directory: osc_client
run: cmake -Bbuild -A x64 -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DM1_ORIENTATION_MANAGER_EMBEDDED=1
- name: OC Build
working-directory: osc_client
shell: bash
run: cmake --build build --config $BUILD_TYPE
- name: OM & OC Extract Keys and Codesign (macos)
if: runner.os == 'MacOS'
# Extract the secrets we defined earlier as environment variables
env:
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
MACOS_CERTIFICATE_NAME: ${{ secrets.MACOS_CERTIFICATE_NAME }}
MACOS_CI_KEYCHAIN_PWD: ${{ secrets.MACOS_CI_KEYCHAIN_PWD }}
run: |
# Turn our base64-encoded certificate back to a regular .p12 file
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
# We need to create a new keychain, otherwise using the certificate will prompt
# with a UI dialog asking for the certificate password, which we can't
# use in a headless CI environment
security create-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain
security import certificate.p12 -k build.keychain -P "$MACOS_CERTIFICATE_PWD" -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$MACOS_CI_KEYCHAIN_PWD" build.keychain
# We finally codesign our app bundle, specifying the Hardened runtime option
/usr/bin/codesign -v --force -s "$MACOS_CERTIFICATE_NAME" --options runtime --entitlements Resources/entitlements.mac.plist --timestamp osc_client/build/M1-OrientationOSC_artefacts/Release/M1-OrientationOSC.app/Contents/MacOS/m1-orientationmanager
/usr/bin/codesign -v --force -s "$MACOS_CERTIFICATE_NAME" --options runtime --entitlements osc_client/Resources/M1-OrientationOSC.entitlements --timestamp osc_client/build/M1-OrientationOSC_artefacts/Release/M1-OrientationOSC.app
- name: OC Package (macos)
uses: akiojin/[email protected]
with:
root-directory: ${{ github.workspace }}/osc_client/build/M1-OrientationOSC_artefacts/Release
bundle-path: M1-OrientationOSC.app
identifier: ${{ env.OC_BUNDLE_ID }}
install-location: /Application/Mach1/OSC-Tool
version: ${{ env.VERSION }}
output-directory: ${{ github.workspace }}/osc_client/build/m1-OrientationOSC_artefacts/Release
- name: OC Notarize (macos)
if: runner.os == 'MacOS'
uses: cocoalibs/xcode-notarization-action@v1
with:
working-directory: osc_client
app-path: ${{ github.workspace }}/osc_client/build/M1-OrientationOSC_artefacts/Release/M1-OrientationOSC.pkg
apple-id: ${{ secrets.MACOS_NOTARIZE_USER }}
password: ${{ secrets.MACOS_NOTARIZE_PWD }}
team-id: ${{ secrets.TEAM_ID }}
# Further Parameters:
staple: 'true' # if you wish to skip running stapler
- name: OC InnoSetup Installer (windows)
if: runner.os == 'Windows'
working-directory: osc_client/build
run: |
"%programfiles(x86)%\Inno Setup 6\iscc.exe" /DBuildDir="${{github.workspace}}\osc_client" "${{github.workspace}}\osc_client\Resources\InnoSetup.iss"
shell: cmd
- name: 'OC Upload Artifact (macos)'
if: runner.os == 'MacOS'
uses: actions/upload-artifact@v2
with:
name: M1-OrientationOSC (MacOS)
working-directory: osc_client
path: build/m1-M1-OrientationOSC_artefacts/Release/M1-OrientationOSC.pkg
if-no-files-found: error
- name: 'OC Upload Artifact (windows)'
if: runner.os == 'Windows'
uses: actions/upload-artifact@v2
with:
name: M1-OrientationOSC (Windows)
working-directory: osc_client
path: build\m1-M1-OrientationOSC_artefacts\Release\Output\M1-OrientationOSC_WIN.exe
if-no-files-found: error