-
Notifications
You must be signed in to change notification settings - Fork 68
244 lines (212 loc) · 9.72 KB
/
all.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
name: Compile, Test, and Deploy
on:
pull_request: {}
# push:
# branches:
# - main
release:
types: [published]
jobs:
build-ubuntu:
runs-on: ubuntu-20.04
strategy:
# fail-fast: false
matrix:
include:
- { python-version: "3.8", pythonLibPath: "/opt/python/cp39-cp38/lib", pythonInclude: "/opt/python/cp38-cp38/include/python3.8", cibwbuild: "cp38-manylinux_x86_64"}
- { python-version: "3.9", pythonLibPath: "/opt/python/cp39-cp39/lib", pythonInclude: "/opt/python/cp39-cp39/include/python3.9", cibwbuild: "cp39-manylinux_x86_64"}
- { python-version: "3.10", pythonLibPath: "/opt/python/cp310-cp310/lib", pythonInclude: "/opt/python/cp310-cp310/include/python3.10", cibwbuild: "cp310-manylinux_x86_64"}
- { python-version: "3.11", pythonLibPath: "/opt/python/cp311-cp311/lib", pythonInclude: "/opt/python/cp311-cp311/include/python3.11", cibwbuild: "cp311-manylinux_x86_64"}
- { python-version: "3.12", pythonLibPath: "/opt/python/cp312-cp312/lib", pythonInclude: "/opt/python/cp312-cp312/include/python3.12", cibwbuild: "cp312-manylinux_x86_64"}
# - { python-version: "3.8", pythonLibPath: "/opt/python/cp39-cp38/lib", pythonInclude: "/opt/python/cp38-cp38/include/python3.8", cibwbuild: "cp38-manylinux_aarch64"}
# - { python-version: "3.9", pythonLibPath: "/opt/python/cp39-cp39/lib", pythonInclude: "/opt/python/cp39-cp39/include/python3.9", cibwbuild: "cp39-manylinux_aarch64"}
# - { python-version: "3.10", pythonLibPath: "/opt/python/cp310-cp310/lib", pythonInclude: "/opt/python/cp310-cp310/include/python3.10", cibwbuild: "cp310-manylinux_aarch64"}
# - { python-version: "3.11", pythonLibPath: "/opt/python/cp311-cp311/lib", pythonInclude: "/opt/python/cp311-cp311/include/python3.11", cibwbuild: "cp311-manylinux_aarch64"}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up QEMU for aarch64 on Linux
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
with:
platforms: all
- name: clean faust libraries
run: |
rm -rf dawdreamer/faustlibraries/.git
rm thirdparty/faust/architecture/android/app/lib/libsndfile/lib/armeabi-v7a/libsndfile.so
rm thirdparty/faust/architecture/android/app/lib/libsndfile/lib/arm64-v8a/libsndfile.so
- name: Download libfaust
run: |
cd thirdparty/libfaust
sh download_libfaust.sh
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_PLATFORM: linux
CIBW_BUILD: ${{ matrix.cibwbuild }}
CIBW_BUILD_VERBOSITY: 3
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014
CIBW_BEFORE_BUILD_LINUX:
export PYTHONLIBPATH=${{ matrix.pythonLibPath }} && export PYTHONINCLUDEPATH=${{ matrix.pythonInclude }} && sh -v build_linux.sh
CIBW_REPAIR_WHEEL_COMMAND_LINUX: >
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/dawdreamer:$PWD/thirdparty/libfaust/ubuntu-x86_64/Release/lib && pip install auditwheel-symbols && (auditwheel repair -w {dest_dir} {wheel} || auditwheel-symbols --manylinux 2014 {wheel})
CIBW_TEST_REQUIRES: -r test-requirements.txt soundfile jax[cpu] flax
CIBW_TEST_COMMAND: "rm -rf dawdreamer/*.so* && cd {project}/tests && python -m pytest -v ."
CIBW_ARCHS: auto64
CIBW_ARCHS_LINUX: auto64 aarch64 # On an Linux Intel runner with qemu installed, build Intel and ARM wheels
CIBW_TEST_SKIP: "*38* *39* *311* *312*" # Only care about 310 (current Google Colab version)
- uses: actions/upload-artifact@v3
with:
name: my-wheel-artifact
path: ./wheelhouse/*.whl
build-ubuntu-docker:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Build Docker image
run: docker build -t dawdreamer .
build-windows:
runs-on: ${{ matrix.os }}
strategy:
# fail-fast: false
matrix:
include:
- { os: windows-2022, python-version: "3.8", CIBW-BUILD: "cp38*"}
- { os: windows-2022, python-version: "3.9", CIBW-BUILD: "cp39*"}
- { os: windows-2022, python-version: "3.10", CIBW-BUILD: "cp310*"}
- { os: windows-2022, python-version: "3.11", CIBW-BUILD: "cp311*"}
- { os: windows-2022, python-version: "3.12", CIBW-BUILD: "cp312*"}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Add msbuild to PATH
uses: microsoft/[email protected]
- name: Get CMake
uses: lukka/get-cmake@latest
- name: clean faust libraries
run: |
Remove-Item -Recurse -Force "dawdreamer/faustlibraries/.git"
- name: Download libfaust
shell: cmd
run: |
cd thirdparty/libfaust
call download_libfaust.bat
- name: Build libsamplerate
run: |
cd thirdparty/libsamplerate
cmake -DCMAKE_BUILD_TYPE=Release -Bbuild_release
cd build_release
msbuild libsamplerate.sln /property:Configuration=Release
- name: Build Windows (Release)
run: |
msbuild Builds/VisualStudio2022/DawDreamer.sln /property:Configuration=Release
- name: Install cibuildwheel
run: python -m pip install cibuildwheel
- name: Build Wheels
run: |
python -m cibuildwheel --output-dir wheelhouse
env:
PYTHONMAJOR: ${{ matrix.python-version }}
CIBW_BUILD_VERBOSITY: 1
CIBW_TEST_REQUIRES: -r test-requirements.txt
CIBW_TEST_COMMAND: "cd /D {project}\\tests && python -m pytest -v ."
CIBW_ARCHS: auto64
CIBW_BUILD: ${{matrix.CIBW-BUILD}}
CIBW_TEST_SKIP: "*312*"
- uses: actions/upload-artifact@v3
with:
name: my-wheel-artifact
path: ./wheelhouse/*.whl
- name: "Build docs for GitHub pages"
if: ${{ matrix.python-version == '3.9' && github.event_name == 'release' && github.event.action == 'published' }}
shell: cmd
run: |
pip install -U sphinx
cd docs && make.bat html
- name: Deploy docs
uses: peaceiris/actions-gh-pages@v3
# todo: make condition for being on main branch
if: ${{ matrix.python-version == '3.9' && github.event_name == 'release' && github.event.action == 'published' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build/html
build-macos:
runs-on: ${{ matrix.os }}
strategy:
# fail-fast: false
matrix:
include:
- { os: macos-11, build: cp39-macosx_x86_64, python-version: "3.9", ARCHS: "x86_64" }
- { os: macos-11, build: cp310-macosx_x86_64, python-version: "3.10", ARCHS: "x86_64" }
- { os: macos-11, build: cp311-macosx_x86_64, python-version: "3.11", ARCHS: "x86_64" }
- { os: macos-11, build: cp312-macosx_x86_64, python-version: "3.12", ARCHS: "x86_64" }
- { os: macos-11, build: cp39-macosx_arm64, python-version: "3.9", ARCHS: "arm64" }
- { os: macos-11, build: cp310-macosx_arm64, python-version: "3.10", ARCHS: "arm64" }
- { os: macos-11, build: cp311-macosx_arm64, python-version: "3.11", ARCHS: "arm64" }
- { os: macos-11, build: cp312-macosx_arm64, python-version: "3.12", ARCHS: "arm64" }
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Get CMake
uses: lukka/get-cmake@latest
- name: Build libsamplerate
run: |
cd thirdparty/libsamplerate
cmake -DCMAKE_BUILD_TYPE=Release -Bbuild_release -DCMAKE_OSX_ARCHITECTURES="${{matrix.ARCHS}}" -DLIBSAMPLERATE_EXAMPLES=off -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0
make --directory=build_release
cd ../..
- name: clean faust libraries
run: |
rm -rf dawdreamer/faustlibraries/.git
- name: Download libfaust
run: |
cd thirdparty/libfaust
sh download_libfaust.sh
- name: Build wheels ${{ matrix.python-version }}
uses: pypa/[email protected]
env:
# note that the Projucer project refers to PYTHONMAJOR and pythonLocation, so they must be set here
PYTHONMAJOR: ${{ matrix.python-version }}
MACOSX_DEPLOYMENT_TARGET: 11.0
CIBW_BUILD_VERBOSITY: 1
CIBW_BEFORE_BUILD: |
export pythonLocation=$(python${{matrix.python-version}}-config --prefix)
otool -L $pythonLocation/bin/python3
xcodebuild ARCHS="${{matrix.ARCHS}}" ONLY_ACTIVE_ARCH=NO -configuration Release-${{matrix.ARCHS}} -project Builds/MacOSX/DawDreamer.xcodeproj/ CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED="NO" CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED="NO"
cd Builds/MacOSX/build/Release-${{matrix.ARCHS}}
mv dawdreamer.so.dylib dawdreamer.so
CIBW_TEST_REQUIRES: -r test-requirements.txt jax[cpu] flax
CIBW_TEST_COMMAND: "cd {project}/tests; python -m pytest -v ."
CIBW_BUILD: ${{matrix.build}}
CIBW_ARCHS: auto64
CIBW_ARCHS_MACOS: ${{matrix.ARCHS}}
CIBW_ENVIRONMENT_MACOS: ARCHS="${{matrix.ARCHS}}"
CIBW_TEST_SKIP: "*arm64* *312*"
- uses: actions/upload-artifact@v3
with:
name: my-wheel-artifact
path: ./wheelhouse/*.whl
upload-pypi:
needs: [build-windows, build-ubuntu, build-macos]
runs-on: ubuntu-latest
name: "Upload wheels to PyPI"
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v2
with:
name: my-wheel-artifact
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}