|
| 1 | +name: build |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ master ] |
| 6 | + tags: |
| 7 | + - v* |
| 8 | + pull_request: |
| 9 | + branches: [ master ] |
| 10 | + |
| 11 | +env: |
| 12 | + BUILD_TYPE: Release |
| 13 | + |
| 14 | +jobs: |
| 15 | + # |
| 16 | + # Windows |
| 17 | + # |
| 18 | + # __ |
| 19 | + # |\__/ \ |
| 20 | + # | | |
| 21 | + # | __ | |
| 22 | + # \__/ \| |
| 23 | + # |
| 24 | + # |
| 25 | + maya-win: |
| 26 | + runs-on: windows-2019 |
| 27 | + |
| 28 | + strategy: |
| 29 | + # Without this, all containers stop if any fail |
| 30 | + # That's bad, we want to know whether it's only one |
| 31 | + # or if it happens to multiples or all. |
| 32 | + fail-fast: false |
| 33 | + |
| 34 | + matrix: |
| 35 | + include: |
| 36 | + - maya: "2018" |
| 37 | + 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" |
| 38 | + - maya: "2019" |
| 39 | + 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" |
| 40 | + - maya: "2020" |
| 41 | + 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" |
| 42 | + - maya: "2022" |
| 43 | + 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" |
| 44 | + - maya: "2023" |
| 45 | + devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2023/Autodesk_Maya_2023_DEVKIT_Windows.zip" |
| 46 | + |
| 47 | + steps: |
| 48 | + - name: Checkout code |
| 49 | + uses: actions/checkout@v3 |
| 50 | + with: |
| 51 | + submodules: true |
| 52 | + |
| 53 | + - name: Install devkit |
| 54 | + run: | |
| 55 | + Write-Host "Downloading Devkit: ${{matrix.devkit}}..." |
| 56 | + Invoke-WebRequest -Uri ${{matrix.devkit}} -OutFile "$pwd/devkit.zip" |
| 57 | + Write-Host "Extracting devkit.zip.." |
| 58 | + Expand-Archive -LiteralPath devkit.zip -DestinationPath $pwd |
| 59 | +
|
| 60 | + - name: Configure CMake |
| 61 | + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DMAYA_VERSION="${{matrix.maya}}" -DMAYA_DEVKIT_BASE="$pwd/devkitBase" |
| 62 | + |
| 63 | + - name: Build |
| 64 | + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} |
| 65 | + |
| 66 | + - name: Repath Artifacts |
| 67 | + run: | |
| 68 | + mkdir artifacts/plug-ins |
| 69 | + Copy-Item "./build/${{env.BUILD_TYPE}}/BlurRelax.mll" -Destination "artifacts/plug-ins" |
| 70 | +
|
| 71 | + - name: Upload Artifacts |
| 72 | + uses: actions/upload-artifact@v3 |
| 73 | + with: |
| 74 | + name: windows-${{matrix.maya}} |
| 75 | + path: | |
| 76 | + artifacts/plug-ins/BlurRelax.mll |
| 77 | +
|
| 78 | + maya-macos: |
| 79 | + runs-on: macos-10.15 |
| 80 | + |
| 81 | + strategy: |
| 82 | + fail-fast: false |
| 83 | + |
| 84 | + matrix: |
| 85 | + include: |
| 86 | + - maya: "2018" |
| 87 | + 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" |
| 88 | + - maya: "2019" |
| 89 | + 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" |
| 90 | + - maya: "2020" |
| 91 | + 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" |
| 92 | + - maya: "2022" |
| 93 | + 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" |
| 94 | + - maya: "2023" |
| 95 | + devkit: "https://autodesk-adn-transfer.s3-us-west-2.amazonaws.com/ADN+Extranet/M%26E/Maya/devkit+2023/Autodesk_Maya_2023_DEVKIT_Mac.dmg" |
| 96 | + |
| 97 | + steps: |
| 98 | + - name: Checkout code |
| 99 | + uses: actions/checkout@v3 |
| 100 | + with: |
| 101 | + submodules: true |
| 102 | + |
| 103 | + - name: Install devkit |
| 104 | + run: | |
| 105 | + curl -o devkit.dmg ${{matrix.devkit}} |
| 106 | + 7z x devkit.dmg |
| 107 | +
|
| 108 | + - uses: maxim-lobanov/setup-xcode@v1 |
| 109 | + with: |
| 110 | + xcode-version: '10.3' |
| 111 | + |
| 112 | + - name: Configure CMake |
| 113 | + run: | |
| 114 | + cmake -G Xcode -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DMAYA_VERSION=${{matrix.maya}} -DMAYA_DEVKIT_BASE="$PWD/devkitBase" |
| 115 | +
|
| 116 | + - name: Build |
| 117 | + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} |
| 118 | + |
| 119 | + - name: Repath Artifacts |
| 120 | + run: | |
| 121 | + mkdir -p artifacts/plug-ins |
| 122 | + cp ./build/${{env.BUILD_TYPE}}/BlurRelax.bundle artifacts/plug-ins |
| 123 | +
|
| 124 | + - name: Upload Artifacts |
| 125 | + uses: actions/upload-artifact@v3 |
| 126 | + with: |
| 127 | + name: mac-${{matrix.maya}} |
| 128 | + path: | |
| 129 | + artifacts/plug-ins/BlurRelax.bundle |
| 130 | +
|
| 131 | + maya-linux: |
| 132 | + runs-on: ubuntu-latest |
| 133 | + container: scottenglert/maya-build:${{matrix.maya}} |
| 134 | + |
| 135 | + strategy: |
| 136 | + fail-fast: false |
| 137 | + |
| 138 | + matrix: |
| 139 | + include: |
| 140 | + - maya: "2018.7" |
| 141 | + year: "2018" |
| 142 | + - maya: "2019.3" |
| 143 | + year: "2019" |
| 144 | + - maya: "2020.4" |
| 145 | + year: "2020" |
| 146 | + - maya: "2022.3" |
| 147 | + year: "2022" |
| 148 | + - maya: "2023" |
| 149 | + year: "2023" |
| 150 | + |
| 151 | + steps: |
| 152 | + - name: Checkout code |
| 153 | + uses: actions/checkout@v3 |
| 154 | + with: |
| 155 | + submodules: true |
| 156 | + |
| 157 | + - name: Configure CMake |
| 158 | + run: | |
| 159 | + mkdir build |
| 160 | + cd build |
| 161 | + cmake -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DMAYA_VERSION=${{matrix.maya}} -DMAYA_DEVKIT_BASE="/usr/autodesk/devkitBase" .. |
| 162 | +
|
| 163 | + - name: Build |
| 164 | + run: cmake --build ./build --config ${{env.BUILD_TYPE}} |
| 165 | + |
| 166 | + - name: Repath Artifacts |
| 167 | + run: | |
| 168 | + mkdir -p artifacts/plug-ins |
| 169 | + cp ./build/BlurRelax.so artifacts/plug-ins |
| 170 | +
|
| 171 | + - name: Upload Artifacts |
| 172 | + uses: actions/upload-artifact@v3 |
| 173 | + with: |
| 174 | + name: linux-${{matrix.year}} |
| 175 | + path: | |
| 176 | + artifacts/plug-ins/BlurRelax.so |
| 177 | +
|
| 178 | +# |
| 179 | +# Shipping |
| 180 | +# |
| 181 | +# _________ |
| 182 | +# |\ _ _ _ _\ |
| 183 | +# | \________\ |
| 184 | +# | | | |
| 185 | +# | | | |
| 186 | +# \|________| |
| 187 | +# |
| 188 | +# |
| 189 | + upload_release: |
| 190 | + name: Upload release |
| 191 | + needs: [maya-win, maya-linux, maya-macos] |
| 192 | + runs-on: ubuntu-latest |
| 193 | + |
| 194 | + # Only run on e.g. v0.1.0 |
| 195 | + if: startsWith(github.ref, 'refs/tags/v') |
| 196 | + |
| 197 | + steps: |
| 198 | + - name: Checkout code |
| 199 | + uses: actions/checkout@v3 |
| 200 | + |
| 201 | + - name: Download artifacts |
| 202 | + uses: actions/download-artifact@v3 |
| 203 | + |
| 204 | + # Omitting name: means "download all artifacts" |
| 205 | + # Destination directory structure: |
| 206 | + # ~/modules |
| 207 | + # /BlurRelax |
| 208 | + # /<os_name>-<maya_major_version> |
| 209 | + # /plug-ins |
| 210 | + # BlurRelax.mll |
| 211 | + # /BlurRelax.mod |
| 212 | + |
| 213 | + with: |
| 214 | + path: modules/BlurRelax |
| 215 | + |
| 216 | + - name: Set env |
| 217 | + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV |
| 218 | + |
| 219 | + - name: Create distribution |
| 220 | + run: | |
| 221 | + cp ./BlurRelax.mod modules/ |
| 222 | + mkdir -p modules/BlurRelax/scripts |
| 223 | + cp -r ./scripts modules/BlurRelax |
| 224 | + zip -r BlurRelax-${{env.RELEASE_VERSION}}.zip modules/ |
| 225 | +
|
| 226 | + - name: Upload distribution |
| 227 | + uses: "marvinpinto/action-automatic-releases@latest" |
| 228 | + with: |
| 229 | + repo_token: "${{ secrets.GITHUB_TOKEN }}" |
| 230 | + automatic_release_tag: "latest" |
| 231 | + prerelease: false |
| 232 | + files: | |
| 233 | + BlurRelax-*.zip |
0 commit comments