-
Notifications
You must be signed in to change notification settings - Fork 43
222 lines (190 loc) · 6.18 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
name: build
on:
push:
branches: [ master ]
tags:
- v*
pull_request:
branches: [ master ]
jobs:
compile_plugin:
strategy:
matrix:
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
# 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
maya: 2022
- os: macos-latest
maya: 2023
- os: macos-13
maya: 2024
- os: macos-13
maya: 2025
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:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- 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
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 }}
- name: Save Devkit Cache
if: ${{ steps.cache-devkit.outputs.cache-hit != 'true' }}
id: cache-devkit-save
uses: actions/cache/save@v4
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
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os_name }}-${{ matrix.maya }}
path: |
artifacts/plug-ins/TwistSpline.${{ matrix.ext }}
# Shipping
#
# _________
# |\ _ _ _ _\
# | \________\
# | | |
# | | |
# \|________|
#
#
upload_release:
name: Upload release
needs: compile_plugin
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- 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
with:
path: modules/TwistSpline
- name: Get Latest Tag
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: |
sed "s/DEVELOP/${{env.RELEASE_VERSION}}/" TwistSpline.mod > modules/TwistSpline.mod
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