-
Notifications
You must be signed in to change notification settings - Fork 10
246 lines (208 loc) · 8.45 KB
/
Copy pathcmake_ctest.yml
File metadata and controls
246 lines (208 loc) · 8.45 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
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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
# borrowed from pamplejuce: https://github.com/sudara/pamplejuce
# MIT License
# Copyright (c) 2022 Sudara Williams
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# follow this: https://melatonin.dev/blog/how-to-code-sign-and-notarize-macos-audio-plugins-in-ci/
name: HARP
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: HARP
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
ccache: ccache
- name: Windows
os: windows-latest
pluginval-binary: ./pluginval.exe
ccache: sccache
- name: macOS
os: macos-14
pluginval-binary: pluginval.app/Contents/MacOS/pluginval
ccache: ccache
steps:
# Setup MSVC toolchain and developer command prompt (Windows)
- uses: ilammy/msvc-dev-cmd@v1
# This also starts up our "fake" display Xvfb, needed for pluginval
- 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 ninja-build libcurl4-openssl-dev
sudo /usr/bin/Xvfb $DISPLAY &
- name: Install IPP (Windows)
if: runner.os == 'Windows'
run: |
nuget install intelipp.static.win-x64 -Version 2022.2.0.575
- name: Install Ninja (Windows)
if: runner.os == 'Windows'
run: choco install ninja
- name: Install macOS Deps
if: ${{ matrix.name == 'macOS' }}
run: brew install ninja osxutils
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive # Get JUCE populated
- name: Setup Common Environment Variables
shell: bash
run: |
VERSION=$(cat VERSION)
echo "ARTIFACTS_PATH=${{ env.BUILD_DIR }}/${{ env.PROJECT_NAME }}_artefacts/${{ env.BUILD_TYPE }}" >> $GITHUB_ENV
echo "PRODUCT_NAME=${{ env.PROJECT_NAME }}-$VERSION-${{ matrix.name }}" >> $GITHUB_ENV
- name: Setup Environment Variables for macOS
if: matrix.name == 'macOS'
shell: bash
run: |
echo "STANDALONE_PATH=${{ env.PROJECT_NAME }}_artefacts/${{ env.BUILD_TYPE }}/${{ env.PROJECT_NAME }}.app" >> $GITHUB_ENV
- name: Setup Environment Variables for Windows
if: matrix.name == 'Windows'
shell: bash
run: |
echo "STANDALONE_PATH=${{ env.PROJECT_NAME }}_artefacts/${{ env.BUILD_TYPE }}/${{ env.PROJECT_NAME }}.exe" >> $GITHUB_ENV
- name: Setup Environment Variables for Linux
if: matrix.name == 'Linux'
shell: bash
run: |
echo "STANDALONE_PATH=${{ env.PROJECT_NAME }}_artefacts/${{ env.BUILD_TYPE }}/${{ env.PROJECT_NAME }}" >> $GITHUB_ENV
- name: ccache
uses: hendrikmuhs/ccache-action@main
with:
key: v3-${{ matrix.os }}-${{ matrix.type }}
variant: ${{ matrix.ccache }}
- 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: Set up Python ${{ matrix.python-version }} (Windows)
# if: matrix.name == 'Windows'
# uses: actions/setup-python@v5
# with:
# python-version: '3.10'
- name: Configure
shell: bash
run: cmake -B ${{ env.BUILD_DIR }} -G Ninja -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE}} -DCMAKE_C_COMPILER_LAUNCHER=${{ matrix.ccache }} -DCMAKE_CXX_COMPILER_LAUNCHER=${{ matrix.ccache }} -DCMAKE_OSX_ARCHITECTURES="arm64" .
# dummy configure
# run: mkdir -p ${{ env.BUILD_DIR }}
- name: Build
shell: bash
run: cmake --build ${{ env.BUILD_DIR }} --config ${{ env.BUILD_TYPE }} --parallel 4
# dummy build
# run: touch dummy
# why the python3 -m pip install packaging? see this issue: https://github.com/nodejs/node-gyp/issues/2869
- name: Install Python dependencies for MACOS dmg
if: ${{ matrix.name == 'macOS' }}
run: python3 -m pip install --upgrade packaging pip setuptools --break-system-packages --user
- name: Create DMG, Notarize and Staple (macOS)
if: ${{ matrix.name == 'macOS' }}
run: |
/usr/local/bin/python3 -m pip install packaging
chmod +x ./packaging/package.sh
./packaging/package.sh "${{ secrets.DEVELOPER_ID_APPLICATION}}" "${{ env.ARTIFACTS_PATH }}" "${{ env.PROJECT_NAME }}" "${{ env.PRODUCT_NAME }}" "${{ secrets.NOTARIZATION_USERNAME }}" "${{ secrets.NOTARIZATION_PASSWORD }}" "${{ secrets.TEAM_ID }}"
- name: Upload Zip (Windows)
if: ${{ matrix.name == 'Windows' }}
uses: actions/upload-artifact@v4
with:
name: ${{ env.PRODUCT_NAME }}
path: ${{ env.ARTIFACTS_PATH }}
- name: Upload Zip (Linux)
if: ${{ matrix.name == 'Linux' }}
uses: actions/upload-artifact@v4
with:
name: ${{ env.PRODUCT_NAME }}
path: ${{ env.ARTIFACTS_PATH }}
- name: Upload DMG (macOS)
if: ${{ matrix.name == 'macOS' }}
uses: actions/upload-artifact@v4
with:
name: ${{ env.PRODUCT_NAME }}
path: packaging/${{ env.PRODUCT_NAME }}.dmg
release:
if: contains(github.ref, 'tags/v')
runs-on: ubuntu-latest
needs: build_and_test
steps:
# Needed to access the RELEASE.md file
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
fetch-depth: 1
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: ${{ env.PRODUCT_NAME }}
path: ./artifacts
# - name: Breakpoint if tests failed
# # if: failure()
# uses: namespacelabs/breakpoint-action@v0
# with:
# duration: 30m
# authorized-users: xribene
# zip each of the folders in the artifacts folder
- name: Zip Artifacts
run: |
for d in ./artifacts/*; do
if [ -d "$d" ]; then
echo $d
pushd "$d" > /dev/null
echo $PWD
zip -r ../$(basename "$PWD").zip *
cd ..
rm -rf $(basename "$d")
popd > /dev/null
fi
done
# - name: Display structure of downloaded and zipped files
# run: ls -R
- name: Create Release
id: create_release
uses: ncipollo/release-action@v1
with:
tag: ${{ github.ref_name }}
name: ${{ github.event.repository.name}} ${{ github.ref_name }}
# body: |
# ## Changes
# - Description of changes
bodyFile: ./RELEASE.md
artifacts: ./artifacts/*
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
replacesArtifacts: true