diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c5a61c1..4c6edc2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,10 +1,7 @@ name: build + on: - push: - branches: [ master ] - tags: - - v* pull_request: branches: [ master ] @@ -12,35 +9,16 @@ env: BUILD_TYPE: Release jobs: - # - # Windows - # - # __ - # |\__/ \ - # | | - # | __ | - # \__/ \| - # - # 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" - - maya: "2025" - devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2025/Autodesk_Maya_2025_1_Update_DEVKIT_Windows.zip" steps: - name: Checkout code @@ -48,244 +26,44 @@ jobs: with: submodules: true - - name: Install devkit + - name: Install devkit Windows 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: Install ninja Windows + run: choco install ninja - - name: Build - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + - name: Install meson Windows + uses: actions/setup-python@v5 + with: + python-version: '3.10' + run: pip install meson + + - name: Meson Setup Windows + run: > + meson setup + -Dmaya:maya_version="${{matrix.maya}}" + -Dmaya:maya_devkit_base="$pwd/devkitBase" + --buildtype debugoptimized + --vsenv + --backend ninja + ${{github.workspace}}/build + . + + - name: Compile + run: | + meson compile -C ${{github.workspace}}/build + meson install -C ${{github.workspace}}/build - - name: Repath Artifacts + - name: Repath Artifacts Windows run: | mkdir artifacts/plug-ins - Copy-Item "./build/${{env.BUILD_TYPE}}/TwistSpline.mll" -Destination "artifacts/plug-ins" + Copy-Item ${{github.workspace}}/build/TwistSpline.mll -Destination "artifacts/plug-ins" - - name: Upload Artifacts + - name: Upload Artifacts Windows uses: actions/upload-artifact@v4 with: name: windows-${{matrix.maya}} path: | artifacts/plug-ins/TwistSpline.mll - - # Splitting mac-os into two different steps, as 2024 was made compatible with new arm architecture. - maya-macos-x86_64: - 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" - - 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" - - 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: '14.3.1' - - - name: Configure CMake - run: | - cmake -G Xcode -DCMAKE_OSX_ARCHITECTURES=x86_64 -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 - cp ./build/${{env.BUILD_TYPE}}/TwistSpline.bundle artifacts/plug-ins - - - name: Upload Artifacts - uses: actions/upload-artifact@v4 - with: - name: mac-${{matrix.maya}} - path: | - artifacts/plug-ins/TwistSpline.bundle - - # This will be compiled for both x86_64 and arm64 architectures, as arm support has been added starting from Maya 2024. - maya-macos-arm64: - runs-on: macos-latest - - strategy: - fail-fast: false - - matrix: - include: - - 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" - - maya: "2025" - devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2025/Autodesk_Maya_2025_1_Update_DEVKIT_Mac.dmg" - - 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: '14.3.1' - - - name: Configure CMake - run: | - cmake -G Xcode -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -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 - cp ./build/${{env.BUILD_TYPE}}/TwistSpline.bundle artifacts/plug-ins - - - name: Upload Artifacts - uses: actions/upload-artifact@v4 - with: - name: mac-${{matrix.maya}} - path: | - artifacts/plug-ins/TwistSpline.bundle - - 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" - - maya: "2025" - devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2025/Autodesk_Maya_2025_1_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 - cp "./build/TwistSpline.so" "artifacts/plug-ins" - - - name: Upload Artifacts - uses: actions/upload-artifact@v4 - with: - name: linux-${{matrix.maya}} - path: | - artifacts/plug-ins/TwistSpline.so - - -# -# Shipping -# -# _________ -# |\ _ _ _ _\ -# | \________\ -# | | | -# | | | -# \|________| -# -# - upload_release: - name: Upload release - needs: [maya-win, maya-linux, maya-macos-x86_64, maya-macos-arm64] - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Download artifacts - uses: actions/download-artifact@v4 - - # Omitting name: means "download all artifacts" - # Destination directory structure: - # ~/modules - # /TwistSpline - # /- - # /icons - # /plug-ins - # TwistSpline.mll - # /scripts - # *.py - # *.mel - # /TwistSpline.mod - - with: - path: modules/TwistSpline - - - name: Set env - run: | - LATEST_TAG=$(git describe --tags --abbrev=0 || echo "NOTAG") - echo "LatestTag: ${LATEST_TAG}" - echo "RELEASE_VERSION=${LATEST_TAG}" >> $GITHUB_ENV - - - name: Create distribution - run: | - cp ./TwistSpline.mod modules/ - mkdir -p modules/TwistSpline/scripts - cp -r ./scripts modules/TwistSpline - mkdir -p modules/TwistSpline/icons - cp ./icons/*.png modules/TwistSpline/icons - cp ./icons/*.xpm modules/TwistSpline/icons - zip -r TwistSpline-${{env.RELEASE_VERSION}}.zip modules/ - - - name: Upload Artifacts - uses: actions/upload-artifact@v4 - with: - name: TwistSpline-module - path: TwistSpline-${{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