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

First pass testing composite actions #3

Closed
wants to merge 2 commits into from
Closed
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
188 changes: 36 additions & 152 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,6 +9,13 @@ on:
pull_request:
branches: [ master ]

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

jobs:
compile_plugin:
strategy:
Expand All @@ -25,28 +33,6 @@ jobs:
- maya: 2025
update: 1

# OS specific vars
- os: macos-latest
os_name_u: Mac
os_name: mac
ext: bundle
zip: dmg
- os: macos-13
os_name_u: Mac
os_name: mac
ext: bundle
zip: dmg
- os: windows-latest
os_name_u: Windows
os_name: windows
ext: mll
zip: zip
- os: ubuntu-latest
os_name_u: Linux
os_name: linux
ext: so
zip: tgz

# cross-compiling is annoying so just fall back to macos-13
exclude:
- os: macos-latest
Expand All @@ -61,153 +47,51 @@ jobs:
fail-fast: false

runs-on: ${{ matrix.os }}

env:
DEVKIT_URL: https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+${{ matrix.maya }}/Autodesk_Maya_${{ matrix.maya }}_${{ matrix.update }}_Update_DEVKIT_${{ matrix.os_name_u }}.${{ matrix.zip }}

steps:
- uses: actions/checkout@v4

- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name : Install ninja
uses: seanmiddleditch/gha-setup-ninja@v5

- name : Install Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name : install meson
run : pip install meson

- name: Restore Devkit Cache
id: cache-devkit
uses: actions/cache/restore@v4
- name: Get Maya Devkit
id: get-devkit
uses: blurstudio/mayaModuleActions/getMayaDevkit@v1
with:
path: ${{ runner.temp }}/devkit/devkit.${{ matrix.zip }}
key: ${{ matrix.os }}-Maya${{ matrix.maya }}-Update${{ matrix.update }}

- name: Download Devkit
if: ${{ steps.cache-devkit.outputs.cache-hit != 'true' }}
run: |
mkdir ${{ runner.temp }}/devkit
curl -o ${{ runner.temp }}/devkit/devkit.${{ matrix.zip }} ${{ env.DEVKIT_URL }}
maya: ${{ matrix.maya }}
update: ${{ matrix.update }}

- name: Save Devkit Cache
if: ${{ steps.cache-devkit.outputs.cache-hit != 'true' }}
id: cache-devkit-save
uses: actions/cache/save@v4
- name: Build
uses: blurstudio/mayaModuleActions/mesonBuild@v1
with:
path: ${{ runner.temp }}/devkit/devkit.${{ matrix.zip }}
key: ${{ matrix.os }}-Maya${{ matrix.maya }}-Update${{ matrix.update }}

- name: Install OpenGL libraries Linux
if: ${{ matrix.os_name == 'linux' }}
run: |
sudo apt install libglu1-mesa-dev

- name : Unpack Devkit Windows
if: ${{ matrix.os_name == 'windows' }}
run: Expand-Archive -LiteralPath "${{ runner.temp }}/devkit/devkit.zip" -DestinationPath "${{ runner.temp }}/devkit"
- name : Unpack Devkit Mac
if: ${{ matrix.os_name == 'mac' }}
run: hdiutil attach ${{ runner.temp }}/devkit/devkit.dmg -mountroot ${{ runner.temp }}/devkit
- name : Unpack Devkit Linux
if: ${{ matrix.os_name == 'linux' }}
run: tar xvzf ${{ runner.temp }}/devkit/devkit.tgz -C ${{ runner.temp }}/devkit

- name: Setup
run: >
meson
setup
-Dmaya:maya_version="${{ matrix.maya }}"
-Dmaya:maya_devkit_base="${{ runner.temp }}/devkit/devkitBase"
--buildtype debugoptimized
--vsenv
--backend ninja
${{ github.workspace }}/build

- name: Compile
run: |
meson compile -C ${{ github.workspace }}/build

- name: Package
run: |
mkdir artifacts
mkdir artifacts/plug-ins
cp ${{ github.workspace }}/build/TwistSpline.${{ matrix.ext }} 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@v4
with:
name: ${{ matrix.os_name }}-${{ matrix.maya }}
path: |
artifacts/plug-ins/TwistSpline.${{ matrix.ext }}
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: compile_plugin
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
# /<os_name>-<maya_major_version>
# /icons
# /plug-ins
# TwistSpline.mll
# /scripts
# *.py
# *.mel
# /TwistSpline.mod

- uses: actions/checkout@v4
- run: git fetch --tags origin
- name: 'Get Previous tag'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
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/
fallback: 0.0.1

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: TwistSpline-module
path: TwistSpline-${{env.RELEASE_VERSION}}.zip
- name: Package
uses: blurstudio/mayaModuleActions/packageMayaModule@v1
with:
module-name: TwistSpline
folder-list: scripts icons
version: ${{ steps.previoustag.outputs.tag }}

- name: Upload distribution
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
Expand Down
59 changes: 0 additions & 59 deletions TwistSpline.mod

This file was deleted.

4 changes: 2 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ maya_dep = dependency('maya')
maya_name_suffix = maya_dep.get_variable('name_suffix')
maya_version = maya_dep.get_variable('maya_version')

source_files = [
source_files = files([
'src/pluginMain.cpp',
'src/drawOverride.cpp',
'src/twistSplineData.cpp',
'src/twistSplineNode.cpp',
'src/riderConstraint.cpp',
'src/twistTangentNode.cpp',
'src/twistMultiTangentNode.cpp',
]
])

harm_inc = include_directories(['src'])

Expand Down
2 changes: 1 addition & 1 deletion quick_compile.bat
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SET BUILDTYPE=debug
SET BUILDDIR=mayabuild_%BUILDTYPE%_%MAYA_VERSION%_%BACKEND%

if not exist %BUILDDIR%\ (
meson setup -Dmaya:maya_version=%MAYA_VERSION% --buildtype %BUILDTYPE% --vsenv %BUILDDIR% --backend %BACKEND%
meson setup %BUILDDIR% -Dmaya:maya_version=%MAYA_VERSION% --buildtype %BUILDTYPE% --vsenv --backend %BACKEND%
)

if exist %BUILDDIR%\ (
Expand Down