1515 NUGET_XMLDOC_MODE : skip
1616 TERM : xterm
1717
18- permissions :
19- contents : read
18+ permissions : {}
2019
2120jobs :
2221 build :
@@ -45,10 +44,14 @@ jobs:
4544
4645 steps :
4746 - name : Checkout code
48- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
47+ uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
48+ with :
49+ filter : ' tree:0'
50+ persist-credentials : false
51+ show-progress : false
4952
5053 - name : Setup .NET SDK
51- uses : actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
54+ uses : actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d # v5.0.0
5255 id : setup-dotnet
5356
5457 # Arcade only allows the revision to contain up to two characters, and GitHub Actions does not roll-over
@@ -69,16 +72,16 @@ jobs:
6972 Write-Output "_AspNetContribBuildNumber=${BuildId}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
7073
7174 - name : Build, Test and Package
72- if : ${{ runner.os == 'Windows' }}
75+ if : runner.os == 'Windows'
7376 run : eng\common\CIBuild.cmd -configuration Release -prepareMachine
7477
7578 - name : Build, Test and Package
7679 shell : pwsh
77- if : ${{ runner.os != 'Windows' }}
80+ if : runner.os != 'Windows'
7881 run : ./eng/common/cibuild.sh -configuration Release -prepareMachine
7982
8083 - name : Attest artifacts
81- uses : actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2.4 .0
84+ uses : actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0 .0
8285 if : |
8386 runner.os == 'Windows' &&
8487 github.event.repository.fork == false &&
9396
9497 - name : Publish logs
9598 uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
96- if : ${{ always () }}
99+ if : ${{ !cancelled () }}
97100 with :
98101 name : logs-${{ matrix.os_name }}
99102 path : ./artifacts/log/Release
@@ -106,7 +109,7 @@ jobs:
106109
107110 - name : Publish test results
108111 uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
109- if : ${{ always () }}
112+ if : ${{ !cancelled () }}
110113 with :
111114 name : testresults-${{ matrix.os_name }}
112115 path : ./artifacts/TestResults/Release
@@ -122,7 +125,7 @@ jobs:
122125 name : packages-windows
123126
124127 - name : Setup .NET SDK
125- uses : actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
128+ uses : actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d # v5.0.0
126129 with :
127130 dotnet-version : ${{ needs.build.outputs.dotnet-sdk-version }}
128131
@@ -160,17 +163,23 @@ jobs:
160163 name : packages-windows
161164
162165 - name : Setup .NET SDK
163- uses : actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
166+ uses : actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d # v5.0.0
164167 with :
165168 dotnet-version : ${{ needs.build.outputs.dotnet-sdk-version }}
166169
167170 - name : Push NuGet packages to aspnet-contrib MyGet
168171 env :
169- MYGET_API_KEY : ${{ secrets.MYGET_API_KEY }}
170- run : dotnet nuget push "*.nupkg" --api-key "${MYGET_API_KEY}" --skip-duplicate --source https://www.myget.org/F/aspnet-contrib/api/v3/index.json
172+ API_KEY : ${{ secrets.MYGET_API_KEY }}
173+ SOURCE : https://www.myget.org/F/aspnet-contrib/api/v3/index.json
174+ run : dotnet nuget push "*.nupkg" --api-key "${API_KEY}" --skip-duplicate --source "${SOURCE}"
171175
172176 publish-nuget :
173177 needs : [ build, validate-packages ]
178+ environment :
179+ name : NuGet.org
180+ url : https://www.nuget.org/profiles/aspnet-contrib
181+ permissions :
182+ id-token : write
174183 runs-on : ubuntu-latest
175184 if : |
176185 github.event.repository.fork == false &&
@@ -183,11 +192,18 @@ jobs:
183192 name : packages-windows
184193
185194 - name : Setup .NET SDK
186- uses : actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
195+ uses : actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d # v5.0.0
187196 with :
188197 dotnet-version : ${{ needs.build.outputs.dotnet-sdk-version }}
189198
199+ - name : NuGet log in
200+ uses : NuGet/login@d22cc5f58ff5b88bf9bd452535b4335137e24544 # v1.1.0
201+ id : nuget-login
202+ with :
203+ user : ${{ secrets.NUGET_USER }}
204+
190205 - name : Push NuGet packages to NuGet.org
191206 env :
192- NUGET_API_KEY : ${{ secrets.NUGET_API_KEY }}
193- run : dotnet nuget push "*.nupkg" --api-key "${NUGET_API_KEY}" --skip-duplicate --source https://api.nuget.org/v3/index.json
207+ API_KEY : ${{ steps.nuget-login.outputs.NUGET_API_KEY }}
208+ SOURCE : https://api.nuget.org/v3/index.json
209+ run : dotnet nuget push "*.nupkg" --api-key "${API_KEY}" --skip-duplicate --source "${SOURCE}"
0 commit comments