forked from blurstudio/Simplex
-
Notifications
You must be signed in to change notification settings - Fork 1
372 lines (304 loc) · 11.4 KB
/
main.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
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
name: build
on:
push:
branches: [ master ]
tags:
- v*
pull_request:
branches: [ master ]
env:
BUILD_TYPE: RelWithDebInfo
jobs:
#
# MAYA
#
maya-win:
runs-on: windows-latest
strategy:
# Without this, all containers stop if any fail
# That's bad, we want to know whether it's only one
# or if it happens to multiples or all.
fail-fast: false
matrix:
include:
- maya: "2022"
devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2022/Autodesk_Maya_2022_5_Update_DEVKIT_Windows.zip"
- maya: "2023"
devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2023/Autodesk_Maya_2023_3_Update_DEVKIT_Windows.zip"
- maya: "2024"
devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2024/Autodesk_Maya_2024_2_Update_DEVKIT_Windows.zip"
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: true
- name: Install devkit
run: |
Write-Host "Downloading Devkit: ${{matrix.devkit}}..."
Invoke-WebRequest -Uri ${{matrix.devkit}} -OutFile "$pwd/devkit.zip"
Write-Host "Extracting devkit.zip.."
Expand-Archive -LiteralPath devkit.zip -DestinationPath $pwd
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DMAYA_VERSION="${{matrix.maya}}" -DMAYA_DEVKIT_BASE="$pwd/devkitBase"
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Repath Artifacts
run: |
mkdir artifacts/plug-ins
mkdir artifacts/pyModules
Copy-Item "./build/src/maya/${{env.BUILD_TYPE}}/simplex_maya.mll" -Destination "artifacts/plug-ins"
Copy-Item "./build/src/python/${{env.BUILD_TYPE}}/py*simplex.pyd" -Destination "artifacts/pyModules"
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: win64-${{matrix.maya}}
path: |
artifacts/plug-ins/simplex_maya.mll
artifacts/pyModules/py*simplex.pyd
maya-macos:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
include:
- maya: "2022"
devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2022/Autodesk_Maya_2022_5_Update_DEVKIT_Mac.dmg"
arches: x86_64
- maya: "2023"
devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2023/Autodesk_Maya_2023_3_Update_DEVKIT_Mac.dmg"
arches: x86_64
- maya: "2024"
devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2024/Autodesk_Maya_2024_2_Update_DEVKIT_Mac.dmg"
arches: x86_64;arm64
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: true
- name: Install devkit
run: |
curl -o devkit.dmg ${{matrix.devkit}}
hdiutil attach devkit.dmg
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '13.4'
- name: Configure CMake
run: |
cmake -G Xcode -DCMAKE_OSX_ARCHITECTURES=${{matrix.arches}} -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DMAYA_VERSION=${{matrix.maya}} -DMAYA_DEVKIT_BASE="/Volumes/devkitBase"
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Repath Artifacts
run: |
mkdir -p artifacts/plug-ins
mkdir -p artifacts/pyModules
cp ./build/src/maya/${{env.BUILD_TYPE}}/simplex_maya.bundle artifacts/plug-ins
cp ./build/src/python/${{env.BUILD_TYPE}}/py*simplex.so artifacts/pyModules
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: mac-${{matrix.maya}}
path: |
artifacts/plug-ins/simplex_maya.bundle
artifacts/pyModules/py*simplex.so
maya-linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- maya: "2022"
devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2022/Autodesk_Maya_2022_5_Update_DEVKIT_Linux.tgz"
- maya: "2023"
devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2023/Autodesk_Maya_2023_3_Update_DEVKIT_Linux.tgz"
- maya: "2024"
devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2024/Autodesk_Maya_2024_2_Update_DEVKIT_Linux.tgz"
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: true
- name: Install OpenGL libraries
run: |
sudo apt install libglu1-mesa-dev
- name: Install devkit
run: |
curl -o devkit.tgz ${{matrix.devkit}}
tar xvzf devkit.tgz
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DMAYA_VERSION="${{matrix.maya}}" -DMAYA_DEVKIT_BASE="$PWD/devkitBase"
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Repath Artifacts
run: |
mkdir -p artifacts/plug-ins
mkdir -p artifacts/pyModules
cp ./build/src/maya/simplex_maya.so artifacts/plug-ins
cp ./build/src/python/py*simplex.so artifacts/pyModules
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: linux-${{matrix.year}}
path: |
artifacts/plug-ins/simplex_maya.so
artifacts/pyModules/py*simplex.so
#
# PYTHON
#
python-win:
runs-on: windows-latest
strategy:
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Configure CMake
run: |
cmake -B ${{github.workspace}}/pybuild -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_MAYA=NO -DMAYA_PYTHON=NO -DSYSTEM_PY_VERSION=3
- name: Build
run: |
cmake --build ${{github.workspace}}/pybuild --config ${{env.BUILD_TYPE}}
cp ./pybuild/src/python/${{env.BUILD_TYPE}}/pysimplex.pyd .
- name: Build Wheel
run: |
py -3 -m pip install -U pip
py -3 -m pip install -U build wheel hatch
py -3 -m hatch version $(git describe --tags --abbrev=0)
py -3 -m build --wheel
$PY_WHEEL = Get-ChildItem -Name dist/*.whl
py -3 -m wheel tags --remove --python-tag cp3 --abi-tag abi3 --platform-tag win_amd64 dist/$PY_WHEEL
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist/*.whl
python-macos:
runs-on: macos-latest
strategy:
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '13.4'
- name: Configure CMake
run: |
cmake -G Xcode -B ${{github.workspace}}/pybuild -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_MAYA=NO -DMAYA_PYTHON=NO -DSYSTEM_PY_VERSION=3
- name: Build
run: |
cmake --build ${{github.workspace}}/pybuild --config ${{env.BUILD_TYPE}}
cp ./pybuild/src/python/${{env.BUILD_TYPE}}/pysimplex.so .
- name: Build Wheel
run: |
python3 -m pip install -U pip
python3 -m pip install -U build wheel hatch
python3 -m hatch version $(git describe --tags --abbrev=0)
python3 -m build --wheel
for PY_WHEEL in dist/*.whl
do
python3 -m wheel tags --remove --python-tag cp3 --abi-tag abi3 --platform-tag macosx_10_9_x86_64 ${PY_WHEEL}
done
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist/*.whl
python-linux:
# Use 20.04 for glibc 2.17
runs-on: ubuntu-20.04
strategy:
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Configure CMake
run: |
cmake -B ${{github.workspace}}/pybuild -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_MAYA=NO -DMAYA_PYTHON=NO -DSYSTEM_PY_VERSION=3
- name: Build
run: |
cmake --build ${{github.workspace}}/pybuild --config ${{env.BUILD_TYPE}}
cp ./pybuild/src/python/pysimplex.so .
- name: Build Wheel
run: |
python3 -m pip install -U pip
python3 -m pip install -U build wheel hatch
python3 -m hatch version $(git describe --tags --abbrev=0)
python3 -m build --wheel
for PY_WHEEL in dist/*.whl
do
python3 -m wheel tags --remove --python-tag cp3 --abi-tag abi3 --platform-tag manylinux_2_17_x86_64 ${PY_WHEEL}
done
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist/*.whl
#
# SHIPPING
#
upload_release:
name: Upload release
needs: [maya-win, maya-linux, maya-macos, python-win, python-macos, python-linux]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: modules/simplex
- name: Move Wheels
run: |
mv modules/simplex/wheels/*.whl .
rm -rf modules/simplex/wheels
#- name: Display structure of working directory
# run: ls -R
- name: Build Modfile
run: |
python buildmodfile.py modules/simplex.mod --name simplex --path modules/simplex
- name: Set env
run: |
LATEST_TAG=$(git describe --tags --abbrev=0)
echo "LatestTag: ${LATEST_TAG}"
echo "RELEASE_VERSION=${LATEST_TAG}" >> $GITHUB_ENV
- name: Create distribution
run: |
mkdir -p modules/simplex/scripts
cp -r ./simplexui modules/simplex/scripts
cd modules
zip -r ../simplex-${{ env.RELEASE_VERSION }}.zip .
cd ..
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: simplex-module
path: simplex-${{ env.RELEASE_VERSION }}.zip
- name: Upload distribution
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
*.zip
*.whl
- name: Publish To PyPI
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python3 -m pip install -U pip
python3 -m pip install -U twine
python3 -m twine upload --verbose *.whl