-
Notifications
You must be signed in to change notification settings - Fork 20
254 lines (220 loc) · 8.19 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
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
247
248
249
250
251
252
253
254
name: Build
on:
push:
paths-ignore:
- "**/**.md"
pull_request:
branches:
- master
paths-ignore:
- "**/**.md"
workflow_dispatch:
permissions:
actions: none
checks: none
contents: write
deployments: none
issues: none
packages: read
pull-requests: none
repository-projects: none
security-events: none
statuses: read
defaults:
run:
shell: bash
env:
VCPKG_COMMITTISH: 962e5e39f8a25f42522f51fffc574e05a3efd26b
jobs:
build_windows:
name: Windows
runs-on: windows-2022
strategy:
fail-fast: false
env:
CMAKE_BUILD_TYPE: Release
CMAKE_GENERATOR: Visual Studio 17 2022
VCPKG_TRIPLET: custom-triplet
steps:
- name: Remove Old VS version (Hack)
shell: pwsh
run: |
Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
$InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
$componentsToRemove= @(
"Microsoft.VisualStudio.Component.VC.14.35.17.5.ARM"
"Microsoft.VisualStudio.Component.VC.14.35.17.5.ARM.Spectre"
"Microsoft.VisualStudio.Component.VC.14.35.17.5.ARM64"
"Microsoft.VisualStudio.Component.VC.14.35.17.5.ARM64.Spectre"
"Microsoft.VisualStudio.Component.VC.14.35.17.5.x86.x64"
"Microsoft.VisualStudio.Component.VC.14.35.17.5.x86.x64.Spectre"
"Microsoft.VisualStudio.Component.VC.14.35.17.5.ATL"
"Microsoft.VisualStudio.Component.VC.14.35.17.5.ATL.Spectre"
"Microsoft.VisualStudio.Component.VC.14.35.17.5.ATL.ARM"
"Microsoft.VisualStudio.Component.VC.14.35.17.5.ATL.ARM.Spectre"
"Microsoft.VisualStudio.Component.VC.14.35.17.5.ATL.ARM64"
"Microsoft.VisualStudio.Component.VC.14.35.17.5.ATL.ARM64.Spectre"
"Microsoft.VisualStudio.Component.VC.14.35.17.5.MFC"
"Microsoft.VisualStudio.Component.VC.14.35.17.5.MFC.Spectre"
"Microsoft.VisualStudio.Component.VC.14.35.17.5.MFC.ARM"
"Microsoft.VisualStudio.Component.VC.14.35.17.5.MFC.ARM.Spectre"
"Microsoft.VisualStudio.Component.VC.14.35.17.5.MFC.ARM64"
"Microsoft.VisualStudio.Component.VC.14.35.17.5.MFC.ARM64.Spectre"
)
[string]$workloadArgs = $componentsToRemove | ForEach-Object {" --remove " + $_}
$Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"",$workloadArgs, '--quiet', '--norestart', '--nocache')
# should be run twice
$process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden
$process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden
- name: Checkout Git repository
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- name: Setup vcpkg
uses: friendlyanon/setup-vcpkg@v1
with:
committish: ${{env.VCPKG_COMMITTISH}}
- name: Setup Overlays
uses: actions/checkout@v3
with:
repository: complexlogic/vcpkg
ref: refs/heads/rsgain
path: build/overlays
- name: Configure
run: cmake -S . -B build
-G "${{env.CMAKE_GENERATOR}}"
-DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
-DVCPKG_MANIFEST_FEATURES="ffmpeg;libebur128;inih;"
-DVCPKG_OVERLAY_PORTS=build/overlays/ports
-DVCPKG_OVERLAY_TRIPLETS=config/vcpkg_triplets
-DVCPKG_TARGET_TRIPLET=${{env.VCPKG_TRIPLET}}
- name: Build
run: |
cmake \
--build build \
--target package \
--config ${{ env.CMAKE_BUILD_TYPE }}
build/${{env.CMAKE_BUILD_TYPE}}/rsgain.exe -v
- name: Upload Package
uses: actions/upload-artifact@v3
with:
name: Windows build
path: build/*.zip
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: build/*.zip
build_linux:
name: Linux
runs-on: ubuntu-latest
permissions:
packages: write
strategy:
fail-fast: false
matrix:
config:
- name: Debian
docker_image: debian:bookworm
package_type: DEB
package_ext: .deb
vcpkg_features: fmt;
- name: Fedora
docker_image: fedora:38
package_type: RPM
package_ext: .rpm
vcpkg_features: fmt;
- name: Static
docker_image: debian:bullseye
package_type: TXZ
package_ext: .tar.xz
vcpkg_features: fmt;ffmpeg;libebur128;inih;
container:
image: ${{matrix.config.docker_image}}
env:
CMAKE_BUILD_TYPE: Release
VCPKG_COMMITISH: 51de327421f4bd99b828a97b4e4adde54db032a6
VCPKG_TRIPLET: x64-linux
steps:
- name: Checkout Git repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: "Install dependencies"
run: |
if [[ "${{matrix.config.name}}" == "Debian" ]]; then
apt update && apt install -y curl zip unzip tar build-essential git cmake pkg-config libavcodec-dev libavformat-dev libavutil-dev libswresample-dev libebur128-dev libinih-dev
fi
if [[ "${{matrix.config.name}}" == "Fedora" ]]; then
dnf install -y curl zip unzip tar git make pkg-config gcc-c++ fedora-packager rpmdevtools cmake libavcodec-free-devel libavformat-free-devel libswresample-free-devel libavutil-free-devel libebur128-devel inih-devel
fi
if [[ "${{matrix.config.name}}" == "Static" ]]; then
apt update && apt install -y curl zip unzip tar build-essential git cmake pkg-config python3 nasm
fi
- name: Setup vcpkg
uses: friendlyanon/setup-vcpkg@v1
with:
committish: ${{env.VCPKG_COMMITTISH}}
cache-key: vcpkg-${{matrix.config.name}}-${{env.VCPKG_COMMITISH}}
cache-restore-keys: vcpkg-${{matrix.config.name}}-${{env.VCPKG_COMMITISH}}
- name: Setup Overlays
uses: actions/checkout@v3
with:
repository: complexlogic/vcpkg
ref: refs/heads/rsgain
path: build/overlays
- name: Configure
run: cmake -S . -B build
-DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
-DVCPKG_TARGET_TRIPLET=${{env.VCPKG_TRIPLET}}
-DVCPKG_MANIFEST_FEATURES="${{matrix.config.vcpkg_features}}"
-DVCPKG_OVERLAY_PORTS=build/overlays/ports
-DCMAKE_BUILD_TYPE=${{env.CMAKE_BUILD_TYPE}}
-DCMAKE_INSTALL_PREFIX=/usr
-DPACKAGE=${{matrix.config.package_type}}
- name: Build
run: |
cmake \
--build build \
--target package
build/rsgain -v
- name: Upload Package
uses: actions/upload-artifact@v3
with:
name: ${{matrix.config.name}} build
path: build/*${{matrix.config.package_ext}}
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: build/*${{matrix.config.package_ext}}
token: ${{secrets.ACTIONS_SECRET}}
build_macos:
name: macOS
runs-on: macos-12
permissions:
packages: write
strategy:
fail-fast: false
env:
CMAKE_BUILD_TYPE: Release
steps:
- name: Checkout Git repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: "Install dependencies"
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install libebur128 taglib ffmpeg fmt inih cmake pkg-config || true
- name: Configure
run: cmake -S . -B build
-DCMAKE_BUILD_TYPE=${{env.CMAKE_BUILD_TYPE}}
-DCMAKE_INSTALL_PREFIX=/usr
- name: Build
run: |
cmake \
--build build \
--config ${{env.CMAKE_BUILD_TYPE}}
build/rsgain -v