Skip to content

Commit d9a7510

Browse files
committed
Update the workflow to build the wheels and version everything on upload
Use pip to install the latest cmake on linux, and cast some methods to void* for gcc
1 parent 476d575 commit d9a7510

File tree

8 files changed

+85
-232
lines changed

8 files changed

+85
-232
lines changed

.github/workflows/main.yml

Lines changed: 70 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@ jobs:
2828

2929
matrix:
3030
include:
31-
- maya: "2018"
32-
devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2018/Autodesk_Maya_2018_7_Update_DEVKIT_Windows.zip"
33-
- maya: "2019"
34-
devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2019/Autodesk_Maya_2019_3_Update_DEVKIT_Windows.zip"
35-
- maya: "2020"
36-
devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2020/Autodesk_Maya_2020_4_Update_DEVKIT_Windows.zip"
3731
- maya: "2022"
3832
devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2022/Autodesk_Maya_2022_3_Update_DEVKIT_Windows.zip"
3933
- maya: "2023"
@@ -83,12 +77,6 @@ jobs:
8377

8478
matrix:
8579
include:
86-
- maya: "2018"
87-
devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2018/Autodesk_Maya_2018_7_Update_DEVKIT_Mac.dmg"
88-
- maya: "2019"
89-
devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2019/Autodesk_Maya_2019_3_Update_DEVKIT_Mac.dmg"
90-
- maya: "2020"
91-
devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2020/Autodesk_Maya_2020_4_Update_DEVKIT_Mac.dmg"
9280
- maya: "2022"
9381
devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2022/Autodesk_Maya_2022_3_Update_DEVKIT_Mac.dmg"
9482
- maya: "2023"
@@ -189,15 +177,6 @@ jobs:
189177

190178
matrix:
191179
include:
192-
# The 2018 and 2019 containers use cmake 3.9, and I'm using functions introduced in 3.16
193-
#- maya: "2018.7"
194-
# year: "2018"
195-
#- maya: "2019.3"
196-
# year: "2019"
197-
- maya: "2020.4"
198-
year: "2020"
199-
- maya: "2022.3"
200-
year: "2022"
201180
- maya: "2023"
202181
year: "2023"
203182
- maya: "2024"
@@ -209,6 +188,10 @@ jobs:
209188
with:
210189
submodules: true
211190

191+
- name: Install latest cmake
192+
run: |
193+
python3 -m pip install cmake
194+
212195
- name: Configure CMake
213196
run: |
214197
mkdir build
@@ -245,63 +228,75 @@ jobs:
245228

246229
steps:
247230
- name: Checkout code
248-
uses: actions/checkout@v3
231+
uses: actions/checkout@v4
249232
with:
250233
submodules: true
234+
fetch-depth: 0
251235

252236
- name: Configure CMake
253237
run: |
254-
$PYVER = py -c "import sys;print(f'{sys.version_info.major}.{sys.version_info.minor}')"
255-
cmake -B ${{github.workspace}}/pybuild -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_MAYA=NO -DMAYA_PYTHON=NO -DSYSTEM_PY_VERSION=$PYVER
238+
cmake -B ${{github.workspace}}/pybuild -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_MAYA=NO -DMAYA_PYTHON=NO -DSYSTEM_PY_VERSION=3
256239
257240
- name: Build
258-
run: cmake --build ${{github.workspace}}/pybuild --config ${{env.BUILD_TYPE}}
241+
run: |
242+
cmake --build ${{github.workspace}}/pybuild --config ${{env.BUILD_TYPE}}
243+
cp ./pybuild/src/python/${{env.BUILD_TYPE}}/pysimplex.pyd .
259244
260245
- name: Build Wheel
261-
run: echo "Build Wheel"
246+
run: |
247+
py -3 -m pip install -U build wheel hatch
248+
py -3 -m hatch version $(git describe --tags --abbrev=0)
249+
py -3 -m build --wheel
250+
$PY_WHEEL = Get-ChildItem -Name dist/*.whl
251+
py -3 -m wheel tags --remove --python-tag cp3 --abi-tag abi3 --platform-tag win_amd64 dist/$PY_WHEEL
262252
263253
- name: Upload Artifacts
264254
uses: actions/upload-artifact@v3
265255
with:
266-
name: win64-${{matrix.maya}}
267-
path: |
268-
artifacts/plug-ins/simplex_maya.mll
269-
artifacts/pyModules/py*simplex.pyd
256+
name: wheels
257+
path: dist/*.whl
270258

271259
python-macos:
272-
runs-on: macos
260+
runs-on: macos-12
273261

274262
strategy:
275263
fail-fast: false
276264

277265
steps:
278266
- name: Checkout code
279-
uses: actions/checkout@v3
267+
uses: actions/checkout@v4
280268
with:
281269
submodules: true
270+
fetch-depth: 0
282271

283272
- uses: maxim-lobanov/setup-xcode@v1
284273
with:
285274
xcode-version: '13.4'
286275

287276
- name: Configure CMake
288277
run: |
289-
PYVER = python3 -c "import sys;print(f'{sys.version_info.major}.{sys.version_info.minor}')"
290-
cmake -G Xcode -B ${{github.workspace}}/pybuild -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_MAYA=NO -DMAYA_PYTHON=NO -DSYSTEM_PY_VERSION=$PYVER
278+
cmake -G Xcode -B ${{github.workspace}}/pybuild -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_MAYA=NO -DMAYA_PYTHON=NO -DSYSTEM_PY_VERSION=3
291279
292280
- name: Build
293-
run: cmake --build ${{github.workspace}}/pybuild --config ${{env.BUILD_TYPE}}
281+
run: |
282+
cmake --build ${{github.workspace}}/pybuild --config ${{env.BUILD_TYPE}}
283+
cp ./pybuild/src/python/${{env.BUILD_TYPE}}/pysimplex.so .
294284
295285
- name: Build Wheel
296-
run: echo "Build Wheel"
286+
run: |
287+
python3 -m pip install -U build wheel hatch
288+
python3 -m hatch version $(git describe --tags --abbrev=0)
289+
python3 -m build --wheel
290+
for PY_WHEEL in dist/*.whl
291+
do
292+
python3 -m wheel tags --remove --python-tag cp3 --abi-tag abi3 --platform-tag macosx_10_9_x86_64 ${PY_WHEEL}
293+
done
297294
298295
- name: Upload Artifacts
299296
uses: actions/upload-artifact@v3
300297
with:
301-
name: mac-${{matrix.maya}}
302-
path: |
303-
artifacts/plug-ins/simplex_maya.bundle
304-
artifacts/pyModules/py*simplex.so
298+
name: wheels
299+
path: dist/*.whl
305300

306301
python-linux:
307302
runs-on: ubuntu-latest
@@ -311,34 +306,35 @@ jobs:
311306

312307
steps:
313308
- name: Checkout code
314-
uses: actions/checkout@v3
309+
uses: actions/checkout@v4
315310
with:
316311
submodules: true
312+
fetch-depth: 0
317313

318314
- name: Configure CMake
319315
run: |
320-
mkdir build
321-
cd build
322-
cmake -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DMAYA_VERSION=${{matrix.maya}} -DMAYA_DEVKIT_BASE="/usr/autodesk/devkitBase" ..
323-
324-
- name: Configure CMake
325-
run: |
326-
PYVER = python3 -c "import sys;print(f'{sys.version_info.major}.{sys.version_info.minor}')"
327-
cmake -G Xcode -B ${{github.workspace}}/pybuild -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_MAYA=NO -DMAYA_PYTHON=NO -DSYSTEM_PY_VERSION=$PYVER
316+
cmake -B ${{github.workspace}}/pybuild -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_MAYA=NO -DMAYA_PYTHON=NO -DSYSTEM_PY_VERSION=3
328317
329318
- name: Build
330-
run: cmake --build ${{github.workspace}}/pybuild --config ${{env.BUILD_TYPE}}
319+
run: |
320+
cmake --build ${{github.workspace}}/pybuild --config ${{env.BUILD_TYPE}}
321+
cp ./pybuild/src/python/pysimplex.so .
331322
332323
- name: Build Wheel
333-
run: echo "Build Wheel"
324+
run: |
325+
python3 -m pip install -U build wheel hatch
326+
python3 -m hatch version $(git describe --tags --abbrev=0)
327+
python3 -m build --wheel
328+
for PY_WHEEL in dist/*.whl
329+
do
330+
python3 -m wheel tags --remove --python-tag cp3 --abi-tag abi3 --platform-tag linux_x86_64 ${PY_WHEEL}
331+
done
334332
335333
- name: Upload Artifacts
336334
uses: actions/upload-artifact@v3
337335
with:
338-
name: linux-${{matrix.year}}
339-
path: |
340-
artifacts/plug-ins/simplex_maya.so
341-
artifacts/pyModules/py*simplex.so
336+
name: wheels
337+
path: dist/*.whl
342338

343339
#
344340
# SHIPPING
@@ -351,52 +347,46 @@ jobs:
351347

352348
steps:
353349
- name: Checkout code
354-
uses: actions/checkout@v3
350+
uses: actions/checkout@v4
351+
with:
352+
fetch-depth: 0
355353

356354
- name: Download artifacts
357355
uses: actions/download-artifact@v3
358-
359-
# Omitting name: means "download all artifacts"
360-
# Destination directory structure:
361-
# ~/modules
362-
# /simplex
363-
# /<os_name>-<maya_major_version>
364-
# /plug-ins
365-
# simplex_maya.mll
366-
# /py2Modules
367-
# py2simplex.pyd
368-
# /py3Modules
369-
# py3simplex.pyd
370-
# /simplex.mod
371-
372356
with:
373357
path: modules/simplex
374358

359+
- name: Move Wheels
360+
run: |
361+
mv modules/simplex/wheels/*.whl .
362+
rm -rf modules/simplex/wheels
363+
364+
#- name: Display structure of working directory
365+
# run: ls -R
366+
375367
- name: Build Modfile
376368
run: |
377369
python buildmodfile.py modules/simplex.mod --name simplex --path modules/simplex
378370
379371
- name: Set env
380-
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
372+
run: |
373+
LATEST_TAG=$(git describe --tags --abbrev=0)
374+
echo "LatestTag: ${LATEST_TAG}"
375+
echo "RELEASE_VERSION=${LATEST_TAG}" >> $GITHUB_ENV
381376
382377
- name: Create distribution
383378
run: |
384379
mkdir -p modules/simplex/scripts
385380
cp -r ./simplexui modules/simplex/scripts
386381
cd modules
387-
zip -r ../simplex.zip .
382+
zip -r ../simplex-${{ env.RELEASE_VERSION }}.zip .
388383
cd ..
389384
390385
- name: Upload Artifacts
391-
if: ${{ ! startsWith(github.ref, 'refs/tags/v') }}
392386
uses: actions/upload-artifact@v3
393387
with:
394388
name: simplex-module
395-
path: simplex.zip
396-
397-
- name: Rename Zip
398-
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
399-
run: mv simplex.zip simplex-${{env.RELEASE_VERSION}}.zip
389+
path: simplex-${{ env.RELEASE_VERSION }}.zip
400390

401391
- name: Upload distribution
402392
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
@@ -405,4 +395,5 @@ jobs:
405395
repo_token: "${{ secrets.GITHUB_TOKEN }}"
406396
prerelease: false
407397
files: |
408-
simplex-*.zip
398+
*.zip
399+
*.whl

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ set(CMAKE_CXX_STANDARD 20)
1111
# )
1212
set(MAYA_VERSION 2020 CACHE STRING "Maya version")
1313
set(MAYA_PYTHON YES CACHE STRING "Link the python module to mayapy")
14-
set(MAYA_2022_PYTHON 2 CACHE STRING "Major Version of python when compiling for Maya 2022")
14+
set(MAYA_2022_PYTHON 3 CACHE STRING "Major Version of python when compiling for Maya 2022")
1515
set(SYSTEM_PY_VERSON 3 CACHE STRING "If Not linking to mayapy, the installed version of python to use")
1616
set(BUILD_MAYA YES CACHE STRING "Build the maya plugin")
1717
set(BUILD_PYTHON YES CACHE STRING "Build the python module")

buildmodfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def main(outpath, modname, modver, modpath):
4747
)
4848
lines.append(f"plug-ins: {rel}")
4949

50-
pypath = rel.replace('plug-ins', 'pyModules')
50+
pypath = str(rel).replace('plug-ins', 'pyModules')
5151
lines.append(f"PYTHONPATH +:= {pypath}")
5252
lines.append("")
5353

mayaConfigure.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
setlocal
22

3-
SET MAYA_VERSION=2024
3+
SET MAYA_VERSION=2022
44
SET BUILD=mayabuild_%MAYA_VERSION%
55
SET COMPILER=Visual Studio 17 2022
66

pyConfigure.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
setlocal
22

3-
SET PY_VERSION=3.9
3+
SET PY_VERSION=3
44
SET BUILD=pybuild
55
SET COMPILER=Visual Studio 17 2022
66

pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
[project]
22
name = "simplexui"
3-
version = "3.0.6"
3+
dynamic = [
4+
"version"
5+
]
6+
47
authors = [
58
{ name="Tyler Fox", email="tyler@blur.com" },
69
]
@@ -40,3 +43,5 @@ artifacts = [
4043
"/*.pyd",
4144
]
4245

46+
[tool.hatch.version]
47+
path = "simplexui/__init__.py"

simplexui/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
SIMPLEX_UI = None
2222
SIMPLEX_UI_ROOT = None
23+
__version__ = "v0.0.0"
2324

2425

2526
def runSimplexUI():

0 commit comments

Comments
 (0)