-
Notifications
You must be signed in to change notification settings - Fork 56
199 lines (175 loc) · 8.38 KB
/
build.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
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
name: Build
on:
workflow_dispatch:
push:
env:
BINARY_NAME: pluginval
BUILD_TYPE: Release
BUILD_DIR: Builds
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DISPLAY: :0 # Running pluginval GUI on linux needs this
jobs:
build:
name: Pluginval Build
strategy:
fail-fast: false
matrix:
include:
- name: Linux
os: ubuntu-latest
app: pluginval
test-binary: ./pluginval
container: ubuntu:22.04
- name: macOS
os: macos-12
app: pluginval.app
test-binary: pluginval.app/Contents/MacOS/pluginval
- name: Windows
os: windows-latest
app: pluginval.exe
test-binary: ./pluginval.exe
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
steps:
- name: Configure Docker container
if: ${{ matrix.name == 'Linux' }}
shell: bash
run: |
# install workflow deps needed because we're on a bare ubuntu container
apt update && apt install -y software-properties-common
add-apt-repository ppa:git-core/ppa -y
apt install -y p7zip-full git wget gpg
apt purge --auto-remove cmake
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null
apt-add-repository 'deb https://apt.kitware.com/ubuntu/ jammy main'
apt update
apt install -y sudo cmake curl tree
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup Environment Variables
shell: bash
run: |
VERSION=$(cat VERSION)
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "APP_DIR=${{ env.BUILD_DIR }}/${{ env.BINARY_NAME }}_artefacts/${{ env.BUILD_TYPE }}" >> $GITHUB_ENV
echo "ZIP_FILE_NAME=${{ env.BINARY_NAME }}_${{ matrix.name }}.zip" >> $GITHUB_ENV
echo "JUCE_SHA1=$(git rev-parse HEAD:modules/juce)" >> $GITHUB_ENV
echo "PLUGIN_BUILD_DIR=modules/juce/Builds" >> $GITHUB_ENV
# This needs to be absolute to make action/cache happy
WORKING_DIR=$(pwd)
echo "PLUGIN_CACHE_PATH=$WORKING_DIR/modules/juce/Builds/examples/Plugins" >> $GITHUB_ENV
- name: Install dependencies (Linux)
if: ${{ matrix.name == 'Linux' }}
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y freeglut3-dev g++ libasound2-dev libcurl4-openssl-dev libfreetype6-dev libjack-jackd2-dev libx11-dev libxcomposite-dev libxcursor-dev libxinerama-dev libxrandr-dev mesa-common-dev ladspa-sdk webkit2gtk-4.0 libgtk-3-dev xvfb
sudo /usr/bin/Xvfb $DISPLAY &
- name: Make VST2 SDK available
shell: bash
run: |
curl -O ${{ secrets.VST2_SDK_URL }}
7z x vstsdk2.4.zip
echo "VST2_SDK_DIR=$(pwd)/vstsdk2.4" >> $GITHUB_ENV
- name: Import Certificates
uses: apple-actions/import-codesign-certs@v3
if: ${{ matrix.name == 'macOS' }}
with:
p12-file-base64: ${{ secrets.DEV_CERT_APP }}
p12-password: ${{ secrets.CERT_PASSWORD }}
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: v2-${{ matrix.name }}-${{ env.BUILD_TYPE }}
- name: Configure
shell: bash
run: cmake -B ${{ env.BUILD_DIR }} -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: Run Pluginval Tests
working-directory: ${{ env.APP_DIR }}
shell: bash
run: |
pwd
ls -ahl
${{ matrix.test-binary }} --run-tests
- name: Cache JUCE example plugin binaries
id: cache-plugins
uses: actions/cache@v3
with:
path: ${{ env.PLUGIN_CACHE_PATH }}
# Increment the version in the key below to manually break plugin cache
key: v7-${{ runner.os }}-${{ env.JUCE_SHA1 }}
- name: Build JUCE example plugins
if: steps.cache-plugins.outputs.cache-hit != 'true'
working-directory: modules/juce
shell: bash
run: |
cmake -B Builds -DJUCE_BUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache .
# Full list of targets https://gist.github.com/sudara/05be084efa371f4e43e21eb19ce04c50
# Be sure to manually break the cache in the previous step if you want to add/remove plugins
cmake --build Builds --config Release --target DSPModulePluginDemo_All --target MultiOutSynthPlugin_All
- name: Validate JUCE Plugin examples (VST3)
shell: bash
run: |
# Paths must be single quoted for bash not to escape the Windows backslash character \ used in absolute paths
${{ env.APP_DIR }}/${{ matrix.test-binary }} --strictness-level 10 --validate '${{ env.PLUGIN_CACHE_PATH }}/DSPModulePluginDemo_artefacts/Release/VST3/DSPModulePluginDemo.vst3'
${{ env.APP_DIR }}/${{ matrix.test-binary }} --strictness-level 10 --validate '${{ env.PLUGIN_CACHE_PATH }}/MultiOutSynthPlugin_artefacts/Release/VST3/MultiOutSynthPlugin.vst3'
- name: Validate JUCE Plugin examples (AU)
shell: bash
continue-on-error: true
if: ${{ matrix.name == 'macOS' }}
run: |
# Move to ~/Library/Audio to be picked up as valid by macOS
# We can't depend on COPY_PLUGIN_AFTER_BUILD, as most of the time we read binaries from the plugin cache
mkdir -p ~/Library/Audio/Plug-Ins/Components/
cp -R ${{ env.PLUGIN_CACHE_PATH }}/DSPModulePluginDemo_artefacts/Release/AU/DSPModulePluginDemo.component ~/Library/Audio/Plug-Ins/Components/
killall -9 AudioComponentRegistrar # kick the AU registrar
${{ env.APP_DIR }}/${{ matrix.test-binary }} --strictness-level 10 --validate ~/Library/Audio/Plug-Ins/Components/DSPModulePluginDemo.component
- name: Codesign (macOS)
if: ${{ matrix.name == 'macOS' }}
run: |
codesign --force -s "${{ secrets.DEVELOPER_ID_APPLICATION}}" -v ${{ env.APP_DIR }}/${{ matrix.app }}/Contents/Libraries/librtcheck.dylib --entitlements ${{ env.BUILD_DIR }}/${{ env.BINARY_NAME }}_artefacts/JuceLibraryCode/${{ env.BINARY_NAME }}.entitlements --deep --strict --options=runtime --timestamp
codesign --force -s "${{ secrets.DEVELOPER_ID_APPLICATION}}" -v ${{ env.APP_DIR }}/${{ matrix.app }} --entitlements ${{ env.BUILD_DIR }}/${{ env.BINARY_NAME }}_artefacts/JuceLibraryCode/${{ env.BINARY_NAME }}.entitlements --deep --strict --options=runtime --timestamp
- name: "Notarize and staple (macOS)"
if: ${{ matrix.name == 'macOS' }}
working-directory: ${{ env.APP_DIR }}
run: |
7z a -tzip ${{ env.ZIP_FILE_NAME }} ${{ matrix.app }}
xcrun notarytool submit ${{ env.ZIP_FILE_NAME }} --apple-id ${{ secrets.NOTARIZATION_USERNAME }} --password ${{ secrets.NOTARIZATION_PASSWORD }} --team-id ${{ secrets.TEAM_ID }} --wait
xcrun stapler staple ${{ matrix.app }}
rm ${{ env.ZIP_FILE_NAME }}
- name: Create zip files
working-directory: ${{ env.APP_DIR }}
run: 7z a -aoa -tzip ${{ env.ZIP_FILE_NAME }} ${{ matrix.app }}
- name: Upload zip files
uses: actions/upload-artifact@v4
with:
name: ${{ env.ZIP_FILE_NAME }}
path: ${{ env.APP_DIR }}/${{ env.ZIP_FILE_NAME }}
# Create release for tagged refs
deploy:
if: contains(github.ref, 'tags/v')
needs: build
runs-on: ubuntu-latest
steps:
# Needed to grab CHANGELIST.md
- uses: actions/checkout@v3
- name: Get Artifacts
uses: actions/download-artifact@v3
with:
path: ./
- name: Display structure of downloaded files
run: ls -la
- name: Create Release
uses: softprops/action-gh-release@v1
with:
body_path: CHANGELIST.md
draft: true
files: |
CHANGELIST.md/*
pluginval_Linux.zip/*
pluginval_macOS.zip/*
pluginval_Windows.zip/*