Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to a meson build #11

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
261 changes: 66 additions & 195 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

name: build

on:
Expand All @@ -8,226 +9,96 @@ on:
pull_request:
branches: [ master ]

env:
BUILD_TYPE: Release
# matrix:
# maya: [2024]
# os: [macos-latest, ubuntu-latest, windows-latest]
# include:
# - maya: 2024
# update: 2

jobs:
#
# Windows
#
# __
# |\__/ \
# | |
# | __ |
# \__/ \|
#
#
maya-win:
runs-on: windows-2019

compile_plugin:
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: "2018"
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"
- maya: "2019"
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"
- maya: "2020"
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"
- maya: "2022"
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"
- maya: "2023"
devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2023/Autodesk_Maya_2023_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
Copy-Item "./build/${{env.BUILD_TYPE}}/BlurRelax.mll" -Destination "artifacts/plug-ins"
maya: [2022, 2023, 2024, 2025]
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: 1

# 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

- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: windows-${{matrix.maya}}
path: |
artifacts/plug-ins/BlurRelax.mll

maya-macos:
runs-on: macos-10.15

strategy:
fail-fast: false

matrix:
include:
- maya: "2018"
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"
- maya: "2019"
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"
- maya: "2020"
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"
- maya: "2022"
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"
- maya: "2023"
devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2023/Autodesk_Maya_2023_DEVKIT_Mac.dmg"

runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: true

- name: Install devkit
run: |
curl -o devkit.dmg ${{matrix.devkit}}
7z x devkit.dmg
- uses: actions/checkout@v4
- run: git fetch --force --tags origin

- uses: maxim-lobanov/setup-xcode@v1
- name: Get Maya Devkit
id: get-devkit
uses: blurstudio/mayaModuleActions/getMayaDevkit@v1
with:
xcode-version: '10.3'

- name: Configure CMake
run: |
cmake -G Xcode -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DMAYA_VERSION=${{matrix.maya}} -DMAYA_DEVKIT_BASE="$PWD/devkitBase"
maya: ${{ matrix.maya }}
update: ${{ matrix.update }}

- 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}}/BlurRelax.bundle artifacts/plug-ins

- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: mac-${{matrix.maya}}
path: |
artifacts/plug-ins/BlurRelax.bundle

maya-linux:
runs-on: ubuntu-latest
container: scottenglert/maya-build:${{matrix.maya}}

strategy:
fail-fast: false

matrix:
include:
- maya: "2018.7"
year: "2018"
- maya: "2019.3"
year: "2019"
- maya: "2020.4"
year: "2020"
- maya: "2022.3"
year: "2022"
- maya: "2023"
year: "2023"

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: blurstudio/mayaModuleActions/mesonBuild@v1
with:
submodules: true

- name: Configure CMake
run: |
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DMAYA_VERSION=${{matrix.maya}} -DMAYA_DEVKIT_BASE="/usr/autodesk/devkitBase" ..

- name: Build
run: cmake --build ./build --config ${{env.BUILD_TYPE}}

- name: Repath Artifacts
run: |
mkdir -p artifacts/plug-ins
cp ./build/BlurRelax.so artifacts/plug-ins
setup-args: >
-Dmaya:maya_version=${{ matrix.maya }}
-Dmaya:maya_devkit_base=${{ steps.get-devkit.outputs.devkit-path }}
--buildtype release
--backend ninja

- name: Upload Artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: linux-${{matrix.year}}
path: |
artifacts/plug-ins/BlurRelax.so
name: ${{ runner.os }}-${{ matrix.maya }}-plugin
path: build/*.${{ steps.get-devkit.outputs.plugin-ext }}
if-no-files-found: error

#
# Shipping
#
# _________
# |\ _ _ _ _\
# | \________\
# | | |
# | | |
# \|________|
#
#
upload_release:
name: Upload release
needs: [maya-win, maya-linux, maya-macos]
needs: compile_plugin
runs-on: ubuntu-latest

# Only run on e.g. v0.1.0
if: startsWith(github.ref, 'refs/tags/v')

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Download artifacts
uses: actions/download-artifact@v3

# Omitting name: means "download all artifacts"
# Destination directory structure:
# ~/modules
# /BlurRelax
# /<os_name>-<maya_major_version>
# /plug-ins
# BlurRelax.mll
# /BlurRelax.mod

- uses: actions/checkout@v4
- run: git fetch --force --tags origin
- name: 'Get Previous tag'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
with:
path: modules/BlurRelax

- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
fallback: 0.0.1

- name: Create distribution
run: |
cp ./BlurRelax.mod modules/
mkdir -p modules/BlurRelax/scripts
cp -r ./scripts modules/BlurRelax
zip -r BlurRelax-${{env.RELEASE_VERSION}}.zip modules/
- name: Package
uses: blurstudio/mayaModuleActions/packageMayaModule@v1
with:
module-name: BlurRelax
folder-list: scripts icons
version: ${{ steps.previoustag.outputs.tag }}

- name: Upload distribution
uses: "marvinpinto/action-automatic-releases@latest"
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
uses: softprops/action-gh-release@v1
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
BlurRelax-*.zip
*.zip
44 changes: 0 additions & 44 deletions BlurRelax.mod

This file was deleted.

36 changes: 0 additions & 36 deletions CMakeLists.txt

This file was deleted.

Loading