forked from jpcima/ysfx
-
Notifications
You must be signed in to change notification settings - Fork 4
203 lines (201 loc) · 7.67 KB
/
build.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: build
on:
push:
branches:
- '*'
tags:
- '[0-9]*'
- 'v[0-9]*'
pull_request:
branches:
- '*'
workflow_dispatch:
jobs:
build:
strategy:
matrix:
include:
- name: win32
display-name: Windows 32-bit
runs-on: windows-2019
platform: x86
release-arch: Win32
cmake-generator: Visual Studio 16 2019
os-type: Windows
shell: pwsh
artifacts: yes
- name: win64
display-name: Windows 64-bit
runs-on: windows-2019
platform: x64
release-arch: x64
cmake-generator: Visual Studio 16 2019
os-type: Windows
shell: pwsh
artifacts: yes
- name: linux64
display-name: Linux 64-bit
runs-on: ubuntu-20.04
platform: x86_64
release-arch: Linux64
os-type: Linux
shell: bash
artifacts: yes
- name: macos
display-name: macOS
runs-on: macos-12
os-type: macOS
shell: bash
artifacts: yes
- name: mingw32
display-name: MSYS MinGW 32-bit
runs-on: windows-2019
platform: i686
msystem: MINGW32
os-type: MinGW
shell: msys2 {0}
artifacts: yes
- name: mingw64
display-name: MSYS MinGW 64-bit
runs-on: windows-2019
platform: x86_64
msystem: MINGW64
os-type: MinGW
shell: msys2 {0}
artifacts: yes
fail-fast: false
name: Compile for ${{matrix.display-name}}
runs-on: ${{matrix.runs-on}}
defaults:
run:
shell: ${{matrix.shell}}
env:
name: ${{matrix.name}}
display_name: ${{matrix.display-name}}
platform: ${{matrix.platform}}
release_arch: ${{matrix.release-arch}}
cmake_generator: ${{matrix.cmake-generator}}
build_type: Release
num_jobs: 2
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies (Linux)
if: ${{matrix.os-type == 'Linux'}}
run: >-
sudo apt-get -y update && sudo apt-get -y install
libsndfile1-dev
libfreetype-dev
libfontconfig-dev
libgl-dev
libx11-dev
libxext-dev
libxrandr-dev
libxinerama-dev
libxcursor-dev
libxss-dev
g++-10
gcc-10
- uses: ilammy/setup-nasm@v1
if: ${{matrix.os-type == 'Windows'}}
- uses: msys2/setup-msys2@v2
if: ${{matrix.os-type == 'MinGW'}}
with:
msystem: ${{matrix.msystem}}
update: true
install: >-
git
mingw-w64-${{matrix.platform}}-toolchain
mingw-w64-${{matrix.platform}}-cmake
mingw-w64-${{matrix.platform}}-ninja
mingw-w64-${{matrix.platform}}-libsndfile
- name: Create Build Directory
working-directory: ${{runner.workspace}}
run: cmake -E make_directory build
- name: Configure CMake (Windows)
if: ${{matrix.os-type == 'Windows'}}
working-directory: ${{runner.workspace}}/build
run: cmake "${Env:GITHUB_WORKSPACE}" -G"${Env:cmake_generator}" -A"${Env:release_arch}" -DCMAKE_BUILD_TYPE="${Env:build_type}" -DYSFX_TESTS=ON
- name: Configure CMake (macOS)
if: ${{matrix.os-type == 'macOS'}}
working-directory: ${{runner.workspace}}/build
run: cmake "${GITHUB_WORKSPACE}" -DCMAKE_BUILD_TYPE="${build_type}" -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DYSFX_TESTS=ON
- name: Configure CMake (Linux)
if: ${{matrix.os-type == 'Linux'}}
working-directory: ${{runner.workspace}}/build
run: cmake "${GITHUB_WORKSPACE}" -DCMAKE_BUILD_TYPE="${build_type}" -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DYSFX_TESTS=ON
env:
CC: gcc-10
CXX: g++-10
- name: Configure CMake (MinGW)
if: ${{matrix.os-type == 'MinGW'}}
working-directory: ${{runner.workspace}}/build
run: cmake "${GITHUB_WORKSPACE}" -DCMAKE_BUILD_TYPE="${build_type}" -DYSFX_TESTS=ON -DYSFX_PLUGIN=OFF
- name: Build tests (Windows)
if: ${{matrix.os-type == 'Windows'}}
working-directory: ${{runner.workspace}}/build
run: cmake --build . --config "${Env:build_type}" --target ysfx_tests -j "${Env:num_jobs}"
- name: Build tests (Linux, macOS and MinGW)
if: ${{matrix.os-type == 'Linux' || matrix.os-type == 'macOS' || matrix.os-type == 'MinGW'}}
working-directory: ${{runner.workspace}}/build
run: cmake --build . --config "${build_type}" --target ysfx_tests -j "${num_jobs}"
- name: Test
working-directory: ${{runner.workspace}}/build
run: ctest --output-on-failure
- name: Build all (Windows)
if: ${{matrix.os-type == 'Windows'}}
working-directory: ${{runner.workspace}}/build
run: cmake --build . --config "${Env:build_type}" -j "${Env:num_jobs}"
- name: Build all (Linux, macOS and MinGW)
if: ${{matrix.os-type == 'Linux' || matrix.os-type == 'macOS' || matrix.os-type == 'MinGW'}}
working-directory: ${{runner.workspace}}/build
run: cmake --build . --config "${build_type}" -j "${num_jobs}"
- name: Reorganize files (windows)
if: ${{matrix.os-type == 'Windows'}}
working-directory: ${{runner.workspace}}
run: |
powershell -Command "New-Item -Path 'VST3' -ItemType Directory -Force"
powershell -Command "New-Item -Path 'CLAP' -ItemType Directory -Force"
powershell -Command "Copy-Item -Path 'build\*_artefacts\${env:build_type}\VST3\*.vst3' -Destination 'VST3' -Recurse"
powershell -Command "Copy-Item -Path 'build\*_artefacts\${env:build_type}\CLAP\*.clap' -Destination 'CLAP' -Recurse"
powershell -Command "Copy-Item -Path '$env:GITHUB_WORKSPACE\plugin_license\*' -Destination '${{runner.workspace}}' -Recurse"
- name: Reorganize files (linux/mac)
if: ${{matrix.os-type == 'Linux' || matrix.os-type == 'macOS'}}
working-directory: ${{runner.workspace}}
run: |
mkdir -p VST3
mkdir -p CLAP
cp -r build/*_artefacts/${{env.build_type}}/VST3/*.vst3 ./VST3
cp -r build/*_artefacts/${{env.build_type}}/CLAP/*.clap ./CLAP
cp -r ${GITHUB_WORKSPACE}/plugin_license/* .
- name: Reorganize files (mac)
if: ${{matrix.os-type == 'macOS'}}
working-directory: ${{runner.workspace}}
run: |
mkdir -p AU
cp -r ./build/*_artefacts/${{env.build_type}}/AU/*.component ./AU
- uses: actions/upload-artifact@v4
if: ${{matrix.artifacts == 'yes'}} && {{matrix.os-type != 'MinGW'}}
with:
name: ${{matrix.display-name}} VST3
path: |
${{runner.workspace}}/VST3/*
${{runner.workspace}}/LICENSE
${{runner.workspace}}/README
- uses: actions/upload-artifact@v4
if: ${{matrix.artifacts == 'yes'}} && {{matrix.os-type != 'MinGW'}}
with:
name: ${{matrix.display-name}} CLAP
path: |
${{runner.workspace}}/CLAP/*
${{runner.workspace}}/LICENSE
${{runner.workspace}}/README
- uses: actions/upload-artifact@v4
if: ${{matrix.os-type == 'macOS' && matrix.artifacts == 'yes'}}
with:
name: ${{matrix.display-name}} AU
path: |
${{runner.workspace}}/AU/*
${{runner.workspace}}/LICENSE
${{runner.workspace}}/README