-
Notifications
You must be signed in to change notification settings - Fork 1
203 lines (171 loc) · 7.9 KB
/
cmake_ctest.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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
name: Pamplejuce
on:
workflow_dispatch: # lets you run a build from the UI
push:
# When pushing new commits, cancel any running builds on that branch
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
env:
PROJECT_NAME: Pamplejuce
BUILD_TYPE: Release
BUILD_DIR: Builds
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DISPLAY: :0 # linux pluginval needs this
CMAKE_BUILD_PARALLEL_LEVEL: 3 # Use up to 3 cpus to build juceaide, etc
HOMEBREW_NO_INSTALL_CLEANUP: 1
# jobs are run in paralell on different machines
# all steps run in series
jobs:
build_and_test:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # show all errors for each platform (vs. cancel jobs on error)
matrix:
include:
- name: Linux
os: ubuntu-22.04
pluginval-binary: ./pluginval
- name: macOS
os: macos-12
pluginval-binary: pluginval.app/Contents/MacOS/pluginval
- name: Windows
os: windows-latest
pluginval-binary: ./pluginval.exe
steps:
- name: Set up Clang
if: ${{ matrix.name != 'macOS' }}
uses: egor-tensin/setup-clang@v1
- name: Install JUCE's Linux Deps
if: runner.os == 'Linux'
# Thanks to McMartin & co https://forum.juce.com/t/list-of-juce-dependencies-under-linux/15121/44
run: |
sudo apt-get update && sudo apt install libasound2-dev libx11-dev libxinerama-dev libxext-dev libfreetype6-dev libwebkit2gtk-4.0-dev libglu1-mesa-dev xvfb fluxbox ninja-build
sudo /usr/bin/Xvfb $DISPLAY &
- name: Install macOS Deps
if: ${{ matrix.name == 'macOS' }}
run: brew install ninja osxutils
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: true # Gotta get JUCE populated
- name: Setup Environment Variables
shell: bash
run: |
VERSION=$(cat VERSION)
echo "ARTIFACTS_PATH=${{ env.BUILD_DIR }}/${{ env.PROJECT_NAME }}_artefacts/${{ env.BUILD_TYPE }}" >> $GITHUB_ENV
echo "VST3_PATH=${{ env.PROJECT_NAME }}_artefacts/${{ env.BUILD_TYPE }}/VST3/${{ env.PROJECT_NAME }}.vst3" >> $GITHUB_ENV
echo "AU_PATH=${{ env.PROJECT_NAME }}_artefacts/${{ env.BUILD_TYPE }}/AU/${{ env.PROJECT_NAME }}.component" >> $GITHUB_ENV
echo "AUV3_PATH=${{ env.PROJECT_NAME }}_artefacts/${{ env.BUILD_TYPE }}/AUv3/${{ env.PROJECT_NAME }}.appex" >> $GITHUB_ENV
echo "PRODUCT_NAME=${{ env.PROJECT_NAME }}-$VERSION-${{ matrix.name }}" >> $GITHUB_ENV
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: v2-${{ matrix.os }}-${{ matrix.type }}
- name: Import Certificates (macOS)
uses: apple-actions/import-codesign-certs@v1
if: ${{ matrix.name == 'macOS' }}
with:
p12-file-base64: ${{ secrets.DEV_ID_APP_CERT }}
p12-password: ${{ secrets.DEV_ID_APP_PASSWORD }}
- name: Configure
shell: bash
run: cmake -B ${{ env.BUILD_DIR }} -G Ninja -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE}} -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" .
- name: Build
shell: bash
run: cmake --build ${{ env.BUILD_DIR }} --config ${{ env.BUILD_TYPE }} --parallel 4
- name: Test
working-directory: ${{ env.BUILD_DIR }}
run: ctest --output-on-failure -j4
- name: Pluginval
working-directory: ${{ env.BUILD_DIR }}
shell: bash
run: |
curl -LO "https://github.com/Tracktion/pluginval/releases/download/v1.0.1/pluginval_${{ matrix.name }}.zip"
7z x pluginval_${{ matrix.name }}.zip
${{ matrix.pluginval-binary }} --strictness-level 10 --verbose --validate "${{ env.VST3_PATH }}"
- name: Codesign (macOS)
working-directory: ${{ env.BUILD_DIR }}
if: ${{ matrix.name == 'macOS' }}
run: |
# Each plugin must be code signed
codesign --force -s "${{ secrets.DEVELOPER_ID_APPLICATION}}" -v ${{ env.VST3_PATH }} --deep --strict --options=runtime --timestamp
codesign --force -s "${{ secrets.DEVELOPER_ID_APPLICATION}}" -v ${{ env.AU_PATH }} --deep --strict --options=runtime --timestamp
- name: Add Custom Icons (macOS)
if: ${{ matrix.name == 'macOS' }}
working-directory: ${{ env.BUILD_DIR }}
run: |
# add the icns as its own icon resource (meta!)
sips -i ../packaging/pamplejuce.icns
# Grab the resource, put in tempfile
DeRez -only icns ../packaging/pamplejuce.icns > /tmp/icons
# Stuff the resource into the strange Icon? file's resource fork
Rez -a /tmp/icons -o ${{ env.VST3_PATH }}/Icon$'\r'
Rez -a /tmp/icons -o ${{ env.AU_PATH }}/Icon$'\r'
# Set custom icon attribute
SetFile -a C ${{ env.VST3_PATH }}
SetFile -a C ${{ env.AU_PATH }}
- name: Create DMG, Notarize and Staple (macOS)
if: ${{ matrix.name == 'macOS' }}
run: |
npm install -g appdmg
mkdir -p packaging/dmg
# Create directories for the dmg symlinks
sudo mkdir -m 755 -p /Library/Audio/Plug-Ins/Components && sudo mkdir -m 755 -p /Library/Audio/Plug-Ins/VST3
ln -s /Library/Audio/Plug-Ins/Components "packaging/dmg/Your Mac's Component folder"
ln -s /Library/Audio/Plug-Ins/VST3 "packaging/dmg/Your Mac's VST3 folder"
mv "${{ env.ARTIFACTS_PATH }}/VST3/${{ env.PROJECT_NAME }}.vst3" packaging/dmg
mv "${{ env.ARTIFACTS_PATH }}/AU/${{ env.PROJECT_NAME }}.component" packaging/dmg
# Run appdmg to create the .dmg
cd packaging && appdmg dmg.json ${{ env.PRODUCT_NAME}}.dmg
codesign -s "${{ secrets.DEVELOPER_ID_APPLICATION}}" --timestamp -i com.pamplejuce.pamplejuce --force ${{ env.PRODUCT_NAME }}.dmg
xcrun notarytool submit ${{ env.PRODUCT_NAME }}.dmg --apple-id ${{ secrets.NOTARIZATION_USERNAME }} --password ${{ secrets.NOTARIZATION_PASSWORD }} --team-id ${{ secrets.TEAM_ID }} --wait
xcrun stapler staple ${{ env.PRODUCT_NAME }}.dmg
- name: Zip
if: ${{ matrix.name == 'Linux' }}
working-directory: ${{ env.ARTIFACTS_PATH }}
run: 7z a -tzip ${{ env.PRODUCT_NAME }}.zip .
- name: Generate Installer and Sign with EV cert on Azure (Windows)
if: ${{ matrix.name == 'Windows' }}
shell: bash
run: |
iscc "packaging\installer.iss"
mv "packaging/Output/${{ env.PRODUCT_NAME }}.exe" "${{ env.ARTIFACTS_PATH }}/"
dotnet tool install --global AzureSignTool
AzureSignTool sign -kvu "${{ secrets.AZURE_KEY_VAULT_URI }}" -kvi "${{ secrets.AZURE_CLIENT_ID }}" -kvt "${{ secrets.AZURE_TENANT_ID }}" -kvs "${{ secrets.AZURE_CLIENT_SECRET }}" -kvc ${{ secrets.AZURE_CERT_NAME }} -tr http://timestamp.digicert.com -v "${{ env.ARTIFACTS_PATH }}/${{ env.PRODUCT_NAME }}.exe"
- name: Upload Exe (Windows)
if: ${{ matrix.name == 'Windows' }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.PRODUCT_NAME }}.exe
path: '${{ env.ARTIFACTS_PATH }}/${{ env.PRODUCT_NAME }}.exe'
- name: Upload Zip (Linux)
if: ${{ matrix.name == 'Linux' }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.PRODUCT_NAME }}.zip
path: '${{ env.ARTIFACTS_PATH }}/${{ env.PRODUCT_NAME }}.zip'
- name: Upload DMG (MacOS)
if: ${{ matrix.name == 'macOS' }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.PRODUCT_NAME }}.dmg
path: packaging/${{ env.PRODUCT_NAME }}.dmg
release:
if: contains(github.ref, 'tags/v')
runs-on: ubuntu-latest
needs: build_and_test
steps:
- name: Get Artifacts
uses: actions/download-artifact@v3
- name: Create Release
uses: softprops/action-gh-release@v1
with:
prerelease: true
# download-artifact puts these files in their own dirs...
# Using globs sidesteps having to pass the version around
files: |
*/*.exe
*/*.zip
*/*.dmg