Tyler/pycleanup #138
Workflow file for this run
This file contains hidden or 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: | |
| tags: | |
| - v* | |
| pull_request: | |
| branches: [ master ] | |
| jobs: | |
| compile_plugin: | |
| strategy: | |
| matrix: | |
| maya: [2022, 2023, 2024, 2025, 2026] | |
| os: [macos-13, macos-latest, ubuntu-latest, windows-latest] | |
| include: | |
| # Add the maya update versions here | |
| - maya: 2022 | |
| update: 5 | |
| - maya: 2023 | |
| update: 3 | |
| - maya: 2024 | |
| update: 2 | |
| - maya: 2025 | |
| update: 3 | |
| - maya: 2026 | |
| update: 2 | |
| # cross-compiling is annoying so just fall back to macos-13 | |
| exclude: | |
| - os: macos-latest | |
| maya: 2022 | |
| - os: macos-latest | |
| maya: 2023 | |
| - os: macos-13 | |
| maya: 2024 | |
| - os: macos-13 | |
| maya: 2025 | |
| - os: macos-13 | |
| maya: 2026 | |
| fail-fast: false | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: 'Checkout repo' | |
| uses: actions/checkout@v5 | |
| - name: 'ACTUALLY get tags' | |
| run: git fetch --force --tag | |
| - name: Get Maya Devkit | |
| id: get-devkit | |
| uses: blurstudio/mayaModuleActions/getMayaDevkit@v1 | |
| with: | |
| maya: ${{ matrix.maya }} | |
| update: ${{ matrix.update }} | |
| - name: Build Maya | |
| uses: blurstudio/mayaModuleActions/mesonBuild@v1 | |
| with: | |
| meson-version: 1.9.0 | |
| setup-args: > | |
| -Dmaya:maya_version=${{ matrix.maya }} | |
| -Dmaya:maya_devkit_base=${{ steps.get-devkit.outputs.devkit-path }} | |
| -Dmaya_build=true | |
| -Dpython_build=false | |
| --buildtype release | |
| --backend ninja | |
| install-args: --skip-subprojects | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ runner.os }}-${{ matrix.maya }}-plugin | |
| path: output_Maya${{ matrix.maya }}/*.${{ steps.get-devkit.outputs.plugin-ext }} | |
| if-no-files-found: error | |
| compile_python: | |
| strategy: | |
| matrix: | |
| # Sorry x86 MacOS, The switch to ARM is maiking this too complicated | |
| # Maya modules don't detect the architecture of the OS, so I've gotta pick | |
| os: [macos-latest, ubuntu-latest, windows-latest] | |
| fail-fast: false | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: 'Checkout repo' | |
| uses: actions/checkout@v5 | |
| - name: 'ACTUALLY get tags' | |
| run: git fetch --force --tags origin | |
| - name: 'Get Previous tag' | |
| id: previoustag | |
| uses: "WyriHaximus/github-action-get-previous-tag@v1" | |
| with: | |
| fallback: v0.0.1 | |
| - name: 'Write version.txt' | |
| run: echo "${{ steps.previoustag.outputs.tag }}" > version.txt | |
| - name: Get pyver macos-latest | |
| if: ${{ matrix.os == 'macos-latest' }} | |
| shell: bash | |
| run: | | |
| echo "PY_VER=3.9" >> $GITHUB_ENV | |
| echo "PY_VER_FLAT=39" >> $GITHUB_ENV | |
| echo "PLAT_TAG=macosx_12_0_arm64" >> $GITHUB_ENV | |
| - name: Get pyver ubuntu-latest | |
| if: ${{ matrix.os == 'ubuntu-latest' }} | |
| shell: bash | |
| run: | | |
| echo "PY_VER=3.9" >> $GITHUB_ENV | |
| echo "PY_VER_FLAT=39" >> $GITHUB_ENV | |
| echo "PLAT_TAG=manylinux_2_17_x86_64" >> $GITHUB_ENV | |
| - name: Get pyver windows-latest | |
| if: ${{ matrix.os == 'windows-latest' }} | |
| shell: bash | |
| run: | | |
| echo "PY_VER=3.7" >> $GITHUB_ENV | |
| echo "PY_VER_FLAT=37" >> $GITHUB_ENV | |
| echo "PLAT_TAG=win_amd64" >> $GITHUB_ENV | |
| - name: Get an older python version | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PY_VER }} | |
| - name: Install pip packages | |
| shell: bash | |
| run: | | |
| python -m pip install -U build wheel | |
| - name: Build Wheel | |
| shell: bash | |
| run: | | |
| python -m build --wheel | |
| for PY_WHEEL in dist/*.whl | |
| do | |
| python -m wheel tags --remove --python-tag ${{ env.PY_VER_FLAT }} --abi-tag abi3 --platform-tag ${{ env.PLAT_TAG }} ${PY_WHEEL} | |
| done | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ runner.os }}-wheels | |
| path: dist/*.whl | |
| if-no-files-found: error | |
| upload_release: | |
| name: Upload release | |
| needs: [compile_plugin, compile_python] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v5 | |
| - name: 'ACTUALLY get tags' | |
| run: git fetch --force --tags origin | |
| - name: Get Previous tag | |
| id: previoustag | |
| uses: "WyriHaximus/github-action-get-previous-tag@v1" | |
| with: | |
| fallback: v0.0.1 | |
| - name: Build the module scripts folder | |
| uses: blurstudio/mayaModuleActions/mesonBuild@v1 | |
| with: | |
| meson-version: 1.9.0 | |
| setup-args: > | |
| -Dmaya_build=false | |
| -Dpython_build=true | |
| -Dpython_script_build=true | |
| install-args: --skip-subprojects | |
| - name: Package | |
| uses: blurstudio/mayaModuleActions/packageMayaModule@v1 | |
| with: | |
| module-name: simplex | |
| folder-list: scripts icons | |
| version: ${{ steps.previoustag.outputs.tag }} | |
| py-limited-api: true | |
| - 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 | |
| - name: Publish To PyPI | |
| if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
| env: | |
| TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | |
| TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
| run: | | |
| shopt -s globstar | |
| cp artifacts/**/*.whl . | |
| python3 -m pip install -U pip | |
| python3 -m pip install -U twine | |
| python3 -m twine upload --verbose *.whl |