File tree Expand file tree Collapse file tree 1 file changed +50
-0
lines changed
Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Publish NuGet Packages
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ buildRunId :
7+ description : " Run ID of the build workflow to download artifacts from"
8+ required : true
9+ type : string
10+ nugetApiKey :
11+ description : " NuGet API key (scoped to push packages)"
12+ required : true
13+ type : string
14+
15+ jobs :
16+ publish :
17+ if : ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }}
18+ runs-on : windows-2022
19+ steps :
20+ - uses : actions/checkout@v4
21+
22+ - name : Setup .NET
23+ uses : actions/setup-dotnet@v4
24+ with :
25+ dotnet-version : 10.0.x
26+
27+ - name : Download NuGet package artifacts
28+ uses : actions/download-artifact@v4
29+ with :
30+ pattern : ICSharpCode.CodeConverter*.nupkg
31+ path : release-artifacts
32+ merge-multiple : true
33+ run-id : ${{ inputs.buildRunId }}
34+
35+ - name : Publish NuGet packages
36+ shell : pwsh
37+ env :
38+ NUGET_API_KEY : ${{ inputs.nugetApiKey }}
39+ run : |
40+ Write-Output "::add-mask::$env:NUGET_API_KEY"
41+ $source = "https://api.nuget.org/v3/index.json"
42+ $packages = @(
43+ "release-artifacts/ICSharpCode.CodeConverter.*.nupkg",
44+ "release-artifacts/ICSharpCode.CodeConverter.CodeConv.*.nupkg"
45+ )
46+ foreach ($pattern in $packages) {
47+ Get-ChildItem -Path $pattern -File | ForEach-Object {
48+ dotnet nuget push $_.FullName -k $env:NUGET_API_KEY -s $source --skip-duplicate
49+ }
50+ }
You can’t perform that action at this time.
0 commit comments