Skip to content

Commit 78e7f0a

Browse files
committed
update Github Actions CI workflow to loop through 3ds Max versions
1 parent 526b119 commit 78e7f0a

2 files changed

Lines changed: 56 additions & 39 deletions

File tree

.github/workflows/cd.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ permissions:
99
contents: write
1010

1111
env:
12-
MAX_VERSIONS: '2022 2023 2024 2025 2026'
12+
MAX_VERSIONS: '2022 2023 2024 2025 2026 2027'
1313
MAYA_VERSIONS: '2020 2022 2023 2024'
1414

1515
jobs:
@@ -47,8 +47,15 @@ jobs:
4747
- name: NuGet Restore - Max
4848
run: nuget restore "3ds Max\Max2Babylon.sln"
4949

50-
- name: Build Max
51-
run: msbuild "3ds Max\Max2Babylon.sln" /p:Configuration=Release /p:Platform=x64 /p:PostBuildEvent= /p:PreBuildEvent= /v:minimal
50+
- name: Build Max (All Versions)
51+
shell: pwsh
52+
run: |
53+
$years = "${{ env.MAX_VERSIONS }}".Split(' ')
54+
foreach ($year in $years) {
55+
$fullConfig = "Release_${year}"
56+
Write-Host "Building $fullConfig"
57+
msbuild "3ds Max\Max2Babylon.sln" /p:Configuration=$fullConfig /p:Platform=x64 /p:PostBuildEvent= /p:PreBuildEvent= /v:minimal
58+
}
5259
5360
# ── Maya ──
5461
- name: NuGet Restore - Maya

.github/workflows/ci.yml

Lines changed: 46 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -7,45 +7,55 @@ on:
77
env:
88
BuildConfiguration: Release
99
BuildPlatform: Any CPU
10-
MAX_VERSIONS: '2022 2023 2024 2025 2026'
1110
MAYA_VERSIONS: '2020 2022 2023 2024'
1211

1312
jobs:
14-
build-max:
15-
name: Build Max
16-
runs-on: windows-latest
17-
steps:
18-
- uses: actions/checkout@v4
19-
with:
20-
fetch-depth: 1
21-
22-
- name: Setup MSBuild
23-
uses: microsoft/setup-msbuild@v2
24-
25-
- name: Setup NuGet
26-
uses: nuget/setup-nuget@v2
27-
with:
28-
nuget-version: '6.x'
29-
30-
- name: Version Update
31-
shell: pwsh
32-
run: |
33-
$content = Get-Content -Path '3ds Max\Max2Babylon\Exporter\BabylonExporter.cs' -Raw
34-
$content = $content -replace 'Custom\.Build\.Version', "${{ github.run_number }}"
35-
Set-Content -Path '3ds Max\Max2Babylon\Exporter\BabylonExporter.cs' -Value $content
36-
37-
- name: NuGet Restore
38-
run: nuget restore "3ds Max\Max2Babylon.sln"
39-
40-
- name: Build
41-
run: msbuild "3ds Max\Max2Babylon.sln" /p:Configuration=${{ env.BuildConfiguration }} /p:Platform=x64 /p:PostBuildEvent= /p:PreBuildEvent= /v:minimal
42-
43-
- name: Upload Artifacts
44-
uses: actions/upload-artifact@v4
45-
if: always()
46-
with:
47-
name: max-binaries
48-
path: 3ds Max/**/bin/**/*.dll
13+
build-max:
14+
name: Build Max (${{ matrix.max_version }} / ${{ matrix.config }})
15+
runs-on: windows-latest
16+
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
max_version: [2022, 2023, 2024, 2025, 2026, 2027]
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 1
26+
27+
- name: Setup MSBuild
28+
uses: microsoft/setup-msbuild@v2
29+
30+
- name: Setup NuGet
31+
uses: nuget/setup-nuget@v2
32+
with:
33+
nuget-version: '6.x'
34+
35+
- name: Version Update
36+
shell: pwsh
37+
run: |
38+
$content = Get-Content -Path '3ds Max\Max2Babylon\Exporter\BabylonExporter.cs' -Raw
39+
$content = $content -replace 'Custom\.Build\.Version', "${{ github.run_number }}"
40+
Set-Content -Path '3ds Max\Max2Babylon\Exporter\BabylonExporter.cs' -Value $content
41+
42+
- name: NuGet Restore
43+
run: nuget restore "3ds Max\Max2Babylon.sln"
44+
45+
- name: Build
46+
run: msbuild "3ds Max\Max2Babylon.sln" `
47+
/p:Configuration=${{ env.BuildConfiguration }}_${{ matrix.max_version }} `
48+
/p:Platform=x64 `
49+
/p:PostBuildEvent= `
50+
/p:PreBuildEvent= `
51+
/v:minimal
52+
53+
- name: Upload Artifacts
54+
uses: actions/upload-artifact@v4
55+
if: always()
56+
with:
57+
name: max-${{ matrix.config }}-${{ matrix.max_version }}
58+
path: 3ds Max/**/bin/**/*.dll
4959

5060
build-maya:
5161
name: Build Maya

0 commit comments

Comments
 (0)