Skip to content

Commit

Permalink
Merge pull request #10 from tbttfox/master
Browse files Browse the repository at this point in the history
Add a maya menu item, and github actions
  • Loading branch information
tbttfox authored Nov 18, 2022
2 parents 97c9045 + 4b0ef05 commit 2093a0a
Show file tree
Hide file tree
Showing 12 changed files with 860 additions and 157 deletions.
233 changes: 233 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
name: build

on:
push:
branches: [ master ]
tags:
- v*
pull_request:
branches: [ master ]

env:
BUILD_TYPE: Release

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

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"
- 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"

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: maxim-lobanov/setup-xcode@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"
- 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
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
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: linux-${{matrix.year}}
path: |
artifacts/plug-ins/BlurRelax.so
#
# Shipping
#
# _________
# |\ _ _ _ _\
# | \________\
# | | |
# | | |
# \|________|
#
#
upload_release:
name: Upload release
needs: [maya-win, maya-linux, maya-macos]
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

with:
path: modules/BlurRelax

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

- 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: Upload distribution
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: false
files: |
BlurRelax-*.zip
44 changes: 44 additions & 0 deletions BlurRelax.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
+ PLATFORM:win64 MAYAVERSION:2018 BlurRelax 1.0.0 BlurRelax
plug-ins: windows-2018/plug-ins

+ PLATFORM:linux MAYAVERSION:2018 BlurRelax 1.0.0 BlurRelax
plug-ins: linux-2018/plug-ins

+ PLATFORM:mac MAYAVERSION:2018 BlurRelax 1.0.0 BlurRelax
plug-ins: mac-2018/plug-ins

+ PLATFORM:win64 MAYAVERSION:2019 BlurRelax 1.0.0 BlurRelax
plug-ins: windows-2019/plug-ins

+ PLATFORM:linux MAYAVERSION:2019 BlurRelax 1.0.0 BlurRelax
plug-ins: linux-2019/plug-ins

+ PLATFORM:mac MAYAVERSION:2019 BlurRelax 1.0.0 BlurRelax
plug-ins: mac-2019/plug-ins

+ PLATFORM:win64 MAYAVERSION:2020 BlurRelax 1.0.0 BlurRelax
plug-ins: windows-2020/plug-ins

+ PLATFORM:linux MAYAVERSION:2020 BlurRelax 1.0.0 BlurRelax
plug-ins: linux-2020/plug-ins

+ PLATFORM:mac MAYAVERSION:2020 BlurRelax 1.0.0 BlurRelax
plug-ins: mac-2020/plug-ins

+ PLATFORM:win64 MAYAVERSION:2022 BlurRelax 1.0.0 BlurRelax
plug-ins: windows-2022/plug-ins

+ PLATFORM:linux MAYAVERSION:2022 BlurRelax 1.0.0 BlurRelax
plug-ins: linux-2022/plug-ins

+ PLATFORM:mac MAYAVERSION:2022 BlurRelax 1.0.0 BlurRelax
plug-ins: mac-2022/plug-ins

+ PLATFORM:win64 MAYAVERSION:2023 BlurRelax 1.0.0 BlurRelax
plug-ins: windows-2023/plug-ins

+ PLATFORM:linux MAYAVERSION:2023 BlurRelax 1.0.0 BlurRelax
plug-ins: linux-2023/plug-ins

+ PLATFORM:mac MAYAVERSION:2023 BlurRelax 1.0.0 BlurRelax
plug-ins: mac-2023/plug-ins
44 changes: 26 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,28 +1,36 @@
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 3.9)

set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/modules)
project(
"BlurRelax"
VERSION 1.0
DESCRIPTION "A quick smooth with border conditions"
LANGUAGES CXX
)

project(BlurRelax)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ${PROJECT_NAME})
find_package(Maya REQUIRED)
find_package(OpenGL REQUIRED)
set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/../output/Maya${MAYA_VERSION})
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
set(CMAKE_CXX_STANDARD 14)

set(SOURCE_FILES
"src/blurRelaxNode.cpp"
# (defined in FindMaya.cmake, copied here for reference)
# set(MAYA_INSTALL_BASE_PATH "" CACHE STRING
# "Root path containing your maya installations, e.g. /usr/autodesk or /Applications/Autodesk/"
# )
set(MAYA_VERSION 2020 CACHE STRING "Maya version")

set(MAYA_FILES
"src/blurRelaxNode.h"
"src/fastRelax.cpp"
"src/fastMayaRelax.h"
"src/fastRelax.h"
"src/blurRelaxNode.cpp"
"src/fastMayaRelax.cpp"
"src/fastMayaRelax.h"
"src/fastRelax.cpp"
"src/pluginRegister.cpp"
)

include_directories(${MAYA_INCLUDE_DIR})
link_directories(${MAYA_LIBRARY_DIR})
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})
target_link_libraries(${PROJECT_NAME} ${MAYA_LIBRARIES} ${OPENGL_LIBRARY})

find_package(Maya REQUIRED)
add_library(${PROJECT_NAME} SHARED ${MAYA_FILES})
target_link_libraries(${PROJECT_NAME} PRIVATE Maya::Maya)
target_include_directories(${PROJECT_NAME}
PRIVATE Maya::Maya
PUBLIC "${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}"
)
MAYA_PLUGIN(${PROJECT_NAME})
install(TARGETS ${PROJECT_NAME} ${MAYA_TARGET_TYPE} DESTINATION plug-ins)

Loading

0 comments on commit 2093a0a

Please sign in to comment.