Tyler/easy installer #30
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: | |
push: | |
branches: [ master ] | |
tags: | |
- v* | |
paths-ignore: | |
- '**.md' | |
- 'simplex_maya_installer.py' | |
pull_request: | |
branches: [ master ] | |
paths-ignore: | |
- '**.md' | |
- 'simplex_maya_installer.py' | |
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@v4 | |
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@v4 | |
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@v4 | |
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@v4 | |
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@v4 | |
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@v4 | |
with: | |
name: linux-${{matrix.maya}} | |
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: Get Correct Python Version | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.7' | |
- 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: | | |
python -m pip install -U pip | |
python -m pip install -U build wheel hatch | |
python -m hatch version $(git describe --tags --abbrev=0) | |
python -m build --wheel | |
$PY_WHEEL = Get-ChildItem -Name dist/*.whl | |
python -m wheel tags --remove --python-tag cp37 --abi-tag abi3 --platform-tag win_amd64 dist/$PY_WHEEL | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels-win | |
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 | |
- name: Get Correct Python Version | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.7' | |
- 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: | | |
python -m pip install -U pip | |
python -m pip install -U build wheel hatch | |
python -m hatch version $(git describe --tags --abbrev=0) | |
python -m build --wheel | |
for PY_WHEEL in dist/*.whl | |
do | |
python -m wheel tags --remove --python-tag cp37 --abi-tag abi3 --platform-tag macosx_10_9_x86_64 ${PY_WHEEL} | |
done | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels-macos | |
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: Get Correct Python Version | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.7' | |
- 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: | | |
python -m pip install -U pip | |
python -m pip install -U build wheel hatch | |
python -m hatch version $(git describe --tags --abbrev=0) | |
python -m build --wheel | |
for PY_WHEEL in dist/*.whl | |
do | |
python -m wheel tags --remove --python-tag cp37 --abi-tag abi3 --platform-tag manylinux_2_17_x86_64 ${PY_WHEEL} | |
done | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels-linux | |
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@v4 | |
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@v4 | |
with: | |
name: simplex-module | |
path: simplex-${{ env.RELEASE_VERSION }}.zip | |
- name: Upload distribution | |
if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
uses: softprops/action-gh-release@v1 | |
with: | |
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 |