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 and Test Biohazrd
@@ -38,11 +38,10 @@ jobs:
3838 os : ubuntu-latest
3939 rid : linux-x64
4040 - name : Linux ARM64
41- os : ubuntu-arm64-latest
41+ os : ubuntu-24.04-arm
4242 rid : linux-arm64
43- skip-tool-install : true
4443 - name : macOS x64
45- os : macos-10.15
44+ os : macos-13
4645 rid : osx-x64
4746 configuration : ['Debug', 'Release']
4847 include :
@@ -58,32 +57,30 @@ jobs:
5857 steps :
5958 # ----------------------------------------------------------------------- Checkout
6059 - name : Checkout
61- uses : actions/checkout@v2
60+ uses : actions/checkout@v4
6261 with :
6362 submodules : recursive
6463
6564 # ----------------------------------------------------------------------- Setup Python
66- - name : Setup Python 3.8
67- if : matrix.platform.skip-tool-install != true
68- uses : actions/setup-python@v2
65+ - name : Setup Python
66+ uses : actions/setup-python@v5
6967 with :
70- python-version : ' 3.8 '
68+ python-version : ' 3.11 '
7169
7270 # ----------------------------------------------------------------------- Setup .NET
7371 - name : Setup .NET
74- if : matrix.platform.skip-tool-install != true
75- uses : actions/setup-dotnet@v1
72+ uses : actions/setup-dotnet@v4
7673 with :
77- dotnet-version : 6.0 .x
74+ dotnet-version : 8 .x
7875
7976 # ----------------------------------------------------------------------- Setup other dependencies
8077 - name : Setup other dependencies (Linux)
81- if : matrix.platform.skip-tool-install != true && runner.os == 'Linux'
78+ if : runner.os == 'Linux'
8279 # This installs lld and llvm-ar, which are used by LinkImportsTransformationElfTests
8380 run : sudo apt-get install --yes lld llvm
8481
8582 - name : Setup other dependencies (macOS)
86- if : matrix.platform.skip-tool-install != true && runner.os == 'macOS'
83+ if : runner.os == 'macOS'
8784 # The LLVM toolchain provided by Xcode is stripped down and doesn't include things like lld or llvm-ar
8885 # However, the runners do have a full LLVM toolchian installed via brew, so we use that for tests which require these tools
8986 run : python .github/workflows/gha.py set_environment_variable BIOHAZRD_FULL_LLVM_TOOLCHAIN_PATH "$(brew --prefix llvm)"
@@ -117,7 +114,7 @@ jobs:
117114
118115 # ----------------------------------------------------------------------- Collect Artifacts
119116 - name : Collect NuGet Packages
120- uses : actions/upload-artifact@v2
117+ uses : actions/upload-artifact@v4
121118 # We always want to collect packages when they were produced
122119 if : steps.pack.outcome == 'success' && always()
123120 with :
@@ -139,50 +136,20 @@ jobs:
139136 steps :
140137 # ----------------------------------------------------------------------- Setup .NET
141138 - name : Setup .NET
142- uses : actions/setup-dotnet@v1
139+ uses : actions/setup-dotnet@v4
143140 with :
144- dotnet-version : 6.0 .x
141+ dotnet-version : 8 .x
145142
146143 # ----------------------------------------------------------------------- Download built packages
147144 - name : Download built packages
148- uses : actions/download-artifact@v2
145+ uses : actions/download-artifact@v4
149146 with :
150147 name : Packages
151148
152149 # ----------------------------------------------------------------------- Upload release assets
153150 - name : Upload release assets
154151 if : github.event_name == 'release'
155- uses : actions/github-script@v4
156- with :
157- user-agent : actions/github-script for ${{github.repository}}
158- script : |
159- const fs = require('fs').promises;
160- const path = require('path');
161- const upload_url = context.payload.release.upload_url;
162-
163- if (!upload_url) {
164- throw "Missing release asset upload URL!";
165- }
166-
167- for (let filePath of await fs.readdir('.')) {
168- const fileExtension = path.extname(filePath);
169- if (fileExtension != '.nupkg' && fileExtension != '.snupkg') {
170- continue;
171- }
172-
173- console.log(`Uploading '${filePath}'`);
174- const contentLength = (await fs.stat(filePath)).size;
175- const fileContents = await fs.readFile(filePath);
176- await github.repos.uploadReleaseAsset({
177- url: upload_url,
178- headers: {
179- 'content-type': 'application/octet-stream',
180- 'content-length': contentLength
181- },
182- name: path.basename(filePath),
183- data: fileContents
184- });
185- }
152+ run : gh release upload ${{github.event.release.tag_name}} *.nupkg *.snupkg --clobber
186153
187154 # ----------------------------------------------------------------------- Push to GitHub Packages
188155 - name : Push to GitHub Packages
@@ -206,49 +173,19 @@ jobs:
206173 steps :
207174 # ----------------------------------------------------------------------- Setup .NET
208175 - name : Setup .NET
209- uses : actions/setup-dotnet@v1
176+ uses : actions/setup-dotnet@v4
210177 with :
211- dotnet-version : 6.0 .x
178+ dotnet-version : 8 .x
212179
213180 # ----------------------------------------------------------------------- Download built packages
214181 - name : Download built packages
215- uses : actions/download-artifact@v2
182+ uses : actions/download-artifact@v4
216183 with :
217184 name : Packages
218185
219186 # ----------------------------------------------------------------------- Push to NuGet.org
220187 - name : Push to NuGet.org
221- run : dotnet nuget push "*.nupkg" --api-key ${{secrets.NUGET_API_KEY}} --source ${{secrets .NUGET_API_URL}}
188+ run : dotnet nuget push "*.nupkg" --api-key ${{secrets.NUGET_API_KEY}} --source ${{vars .NUGET_API_URL}}
222189 env :
223190 # This is a workaround for https://github.com/NuGet/Home/issues/9775
224191 DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER : 0
225-
226- # =====================================================================================================================================================================
227- # Send CI Failure Notification
228- # =====================================================================================================================================================================
229- send-ci-failure-notification :
230- name : Send CI Failure Notification
231- needs : [build-and-test, publish-packages-github, publish-packages-nuget-org]
232- if : failure() && github.event_name != 'pull_request'
233- continue-on-error : true
234- runs-on : ubuntu-latest
235- steps :
236- # ----------------------------------------------------------------------- Checkout
237- - name : Checkout
238- uses : actions/checkout@v2
239-
240- # ----------------------------------------------------------------------- Setup Python
241- - name : Setup Python 3.8
242- uses : actions/setup-python@v2
243- with :
244- python-version : ' 3.8'
245-
246- # ----------------------------------------------------------------------- Send CI Failure Notification
247- - name : Send Notification
248- run : python .github/workflows/send-ci-failure-notification.py
249- env :
250- webhook_url : ${{secrets.TEAMS_WEBHOOK_URL}}
251- github_organization : ${{github.repository_owner}}
252- github_repo : ${{github.repository}}
253- github_workflow_name : ${{github.workflow}}
254- github_run_number : ${{github.run_id}}
0 commit comments