2121 ContinuousIntegrationBuild : true
2222 # This URL will be added to the restore sources if it isn't the official NuGet.org
2323 # (This is mainly intended to allow using the NuGet.org test servers to test CI in forks.)
24- CiNuGetApiUrl : ${{secrets .NUGET_API_URL}}
24+ CiNuGetApiUrl : ${{vars .NUGET_API_URL}}
2525jobs :
2626 # =====================================================================================================================================================================
2727 # Build PhysX
4343 include :
4444 - rid : win-x64
4545 name : Windows x64
46- os : windows-2019
46+ os : windows-2022
4747 build-command : ./build.cmd
4848 physx-install-path : external/PhysX/physx/install/Mochi.PhysX.Windows.x64
4949 physx-compiler-path : external/PhysX/physx/compiler/mochi-physx-win-x64
@@ -52,16 +52,15 @@ jobs:
5252 steps :
5353 # ----------------------------------------------------------------------- Checkout
5454 - name : Checkout
55- uses : actions/checkout@v2
55+ uses : actions/checkout@v4
5656 with :
5757 submodules : recursive
5858
5959 # ----------------------------------------------------------------------- Setup Python
60- - name : Setup Python 3.8
61- if : matrix.platform.skip-tool-install != true
62- uses : actions/setup-python@v2
60+ - name : Setup Python
61+ uses : actions/setup-python@v5
6362 with :
64- python-version : ' 3.8 '
63+ python-version : ' 3.11 '
6564
6665 # ----------------------------------------------------------------------- Get PhysX revision
6766 - name : Get PhysX revision
7170 # ----------------------------------------------------------------------- Build PhysX
7271 - name : Load cached PhysX build outputs
7372 id : cached-physx
74- uses : actions/cache@v2
73+ uses : actions/cache@v4
7574 with :
7675 key : physx-${{matrix.rid}}-${{matrix.configuration.id}}-${{steps.physx.outputs.revision}}-${{hashFiles('build.*', 'tooling/*.cmd', 'tooling/*.sh', 'Mochi.PhysX.Modifications/**')}}
7776 path : physx-${{matrix.rid}}-${{matrix.configuration.id}}.tar.gz
@@ -107,7 +106,7 @@ jobs:
107106 run : gzip physx-${{matrix.rid}}-${{matrix.configuration.id}}.tar
108107
109108 - name : Upload PhysX build artifacts
110- uses : actions/upload-artifact@v2
109+ uses : actions/upload-artifact@v4
111110 with :
112111 name : physx-${{matrix.rid}}
113112 path : physx-${{matrix.rid}}-${{matrix.configuration.id}}.tar.gz
@@ -123,7 +122,7 @@ jobs:
123122 matrix :
124123 include :
125124 - name : Windows x64
126- os : windows-2019
125+ os : windows-2022
127126 rid : win-x64
128127 build-command : ./build.cmd
129128 name : Mochi.PhysX ${{matrix.name}}
@@ -132,24 +131,30 @@ jobs:
132131 # ----------------------------------------------------------------------- Checkout
133132 - name : Checkout
134133 # We intentionally don't checkout submodules here, Mochi.PhysX.Generator should only use outputs from building PhysX
135- uses : actions/checkout@v2
134+ uses : actions/checkout@v4
136135 # TODO: Actually we need them for Biohazrd still. Remove this once we switch to NuGet packages for it.
137136 with :
138137 submodules : recursive
139138
140139 # ----------------------------------------------------------------------- Setup .NET
141140 - name : Setup .NET
142141 if : matrix.platform.skip-tool-install != true
143- uses : actions/setup-dotnet@v1
142+ uses : actions/setup-dotnet@v4
144143 with :
145- # We need both the .NET 5 and .NET 6 SDKs because we currently use C# 10 while targeting .NET 5
144+ # We need both the .NET 5 and .NET 8 SDKs because we currently use C# 10 while targeting .NET 5
146145 dotnet-version : |
147- 5.0.x
148- 6.0.x
146+ 5.x
147+ 8.x
148+
149+ # ----------------------------------------------------------------------- Setup Python
150+ - name : Setup Python
151+ uses : actions/setup-python@v5
152+ with :
153+ python-version : ' 3.11'
149154
150155 # ----------------------------------------------------------------------- Download PhysX builds
151156 - name : Download PhysX ${{matrix.name}} builds
152- uses : actions/download-artifact@v2
157+ uses : actions/download-artifact@v4
153158 with :
154159 name : physx-${{matrix.rid}}
155160
@@ -233,7 +238,7 @@ jobs:
233238 run : tar -cvzf Mochi.PhysX.Native-${{matrix.rid}}.tar.gz bin/Mochi.PhysX.Native
234239 - name : Upload native binaries
235240 if : always()
236- uses : actions/upload-artifact@v2
241+ uses : actions/upload-artifact@v4
237242 with :
238243 name : Mochi.PhysX.Native-${{matrix.rid}}
239244 path : Mochi.PhysX.Native-${{matrix.rid}}.tar.gz
@@ -244,7 +249,7 @@ jobs:
244249 run : tar -cvzf Mochi.PhysX-packages-${{matrix.rid}}.tar.gz packages
245250 - name : Upload NuGet packages
246251 if : always()
247- uses : actions/upload-artifact@v2
252+ uses : actions/upload-artifact@v4
248253 with :
249254 name : Packages
250255 if-no-files-found : error
@@ -256,7 +261,7 @@ jobs:
256261 run : tar -cvzf Mochi.PhysX-${{matrix.rid}}-generated.tar.gz Mochi.PhysX/#Generated Mochi.PhysX.Native/*.gen.*
257262 - name : Upload generated output
258263 if : always()
259- uses : actions/upload-artifact@v2
264+ uses : actions/upload-artifact@v4
260265 with :
261266 name : Mochi.PhysX-${{matrix.rid}}-generated
262267 path : Mochi.PhysX-${{matrix.rid}}-generated.tar.gz
@@ -276,13 +281,13 @@ jobs:
276281 steps :
277282 # ----------------------------------------------------------------------- Setup .NET
278283 - name : Setup .NET
279- uses : actions/setup-dotnet@v1
284+ uses : actions/setup-dotnet@v4
280285 with :
281- dotnet-version : 6.0 .x
286+ dotnet-version : 8 .x
282287
283288 # ----------------------------------------------------------------------- Download built packages
284289 - name : Download built packages
285- uses : actions/download-artifact@v2
290+ uses : actions/download-artifact@v4
286291 with :
287292 name : Packages
288293 - name : Extract built packages
@@ -310,21 +315,21 @@ jobs:
310315 steps :
311316 # ----------------------------------------------------------------------- Setup .NET
312317 - name : Setup .NET
313- uses : actions/setup-dotnet@v1
318+ uses : actions/setup-dotnet@v4
314319 with :
315- dotnet-version : 5.0 .x
320+ dotnet-version : 8 .x
316321
317322 # ----------------------------------------------------------------------- Download built packages
318323 - name : Download built packages
319- uses : actions/download-artifact@v2
324+ uses : actions/download-artifact@v4
320325 with :
321326 name : Packages
322327 - name : Extract built packages
323328 run : for archive in Mochi.PhysX-packages-*.tar.gz; do tar --keep-old-files -xvf "$archive"; done
324329
325330 # ----------------------------------------------------------------------- Push to NuGet.org
326331 - name : Push to NuGet.org
327- run : dotnet nuget push "packages/*.nupkg" --api-key ${{secrets.NUGET_API_KEY}} --source ${{secrets .NUGET_API_URL}}
332+ run : dotnet nuget push "packages/*.nupkg" --api-key ${{secrets.NUGET_API_KEY}} --source ${{vars .NUGET_API_URL}}
328333 env :
329334 # This is a workaround for https://github.com/NuGet/Home/issues/9775
330335 DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER : 0
@@ -340,74 +345,8 @@ jobs:
340345 steps :
341346 # ----------------------------------------------------------------------- Download all artifacts
342347 - name : Download artifacts
343- uses : actions/download-artifact@v2
348+ uses : actions/download-artifact@v4
344349
345350 # ----------------------------------------------------------------------- Upload release assets
346351 - name : Upload release assets
347- uses : actions/github-script@v4
348- with :
349- user-agent : actions/github-script for ${{github.repository}}
350- script : |
351- const fs = require('fs').promises;
352- const path = require('path');
353- const uploadUrl = context.payload.release.upload_url;
354-
355- if (!uploadUrl) {
356- throw "Missing release asset upload URL!";
357- }
358-
359- async function uploadAssets(directoryPath) {
360- for (let filePath of await fs.readdir(directoryPath)) {
361- filePath = path.join(directoryPath, filePath);
362- const stats = await fs.stat(filePath);
363-
364- if (stats.isDirectory()) {
365- console.log(`Entering '${filePath}'`);
366- await uploadAssets(filePath);
367- continue;
368- }
369-
370- console.log(`Uploading '${filePath}'`);
371- await github.repos.uploadReleaseAsset({
372- url: uploadUrl,
373- headers: {
374- 'content-type': 'application/octet-stream',
375- 'content-length': stats.size
376- },
377- name: path.basename(filePath),
378- data: await fs.readFile(filePath)
379- });
380- }
381- }
382-
383- await uploadAssets('.');
384-
385- # =====================================================================================================================================================================
386- # Send CI Failure Notification
387- # =====================================================================================================================================================================
388- send-ci-failure-notification :
389- name : Send CI Failure Notification
390- needs : [build-physx, build-mochi-physx, publish-packages-github, publish-packages-nuget-org, publish-release-assets]
391- if : failure() && github.event_name != 'pull_request'
392- continue-on-error : true
393- runs-on : ubuntu-latest
394- steps :
395- # ----------------------------------------------------------------------- Checkout
396- - name : Checkout
397- uses : actions/checkout@v2
398-
399- # ----------------------------------------------------------------------- Setup Python
400- - name : Setup Python 3.8
401- uses : actions/setup-python@v2
402- with :
403- python-version : ' 3.8'
404-
405- # ----------------------------------------------------------------------- Send CI Failure Notification
406- - name : Send Notification
407- run : python .github/workflows/send-ci-failure-notification.py
408- env :
409- webhook_url : ${{secrets.TEAMS_WEBHOOK_URL}}
410- github_organization : ${{github.repository_owner}}
411- github_repo : ${{github.repository}}
412- github_workflow_name : ${{github.workflow}}
413- github_run_number : ${{github.run_id}}
352+ run : gh release upload ${{github.event.release.tag_name}} **/* --clobber
0 commit comments