File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed
Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 4949 token : ${{ secrets[needs.automation.outputs.token-secret-name] }}
5050 ref : ${{ github.event.repository.default_branch }}
5151
52+ - name : Setup .NET
53+ uses : actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
54+
5255 - name : Push packages and publish release
5356 shell : pwsh
5457 env :
Original file line number Diff line number Diff line change @@ -87,12 +87,15 @@ jobs:
8787 if-no-files-found : error
8888
8989 - name : Publish MyGet
90+ working-directory : ./artifacts/package/release
9091 env :
9192 MYGET_TOKEN_EXISTS : ${{ secrets.MYGET_TOKEN != '' }}
93+ API_KEY : ${{ secrets.MYGET_TOKEN }}
94+ SOURCE : https://www.myget.org/F/opentelemetry/api/v2/package
9295 if : env.MYGET_TOKEN_EXISTS == 'true' # Skip MyGet publish if run on a fork without the secret
96+ shell : pwsh
9397 run : |
94- nuget setApiKey ${{ secrets.MYGET_TOKEN }} -Source https://www.myget.org/F/opentelemetry/api/v2/package
95- nuget push ./artifacts/package/release/*.nupkg -Source https://www.myget.org/F/opentelemetry/api/v2/package
98+ dotnet nuget push *.nupkg --api-key ${env:API_KEY} --skip-duplicate --source ${env:SOURCE}
9699
97100 post-build :
98101 runs-on : ubuntu-22.04
@@ -130,7 +133,7 @@ jobs:
130133 CreateDraftRelease `
131134 -gitRepository '${{ github.repository }}' `
132135 -tag '${{ github.ref_name }}' `
133- -releaseFiles '${{ github.workspace }}/artifacts/${{ github.ref_name }}-packages.zip#Packages '
136+ -releaseFiles '${{ github.workspace }}/artifacts/${{ github.ref_name }}-packages.zip'
134137
135138 - name : Post notice when packages are ready
136139 shell : pwsh
Original file line number Diff line number Diff line change @@ -236,7 +236,7 @@ function PushPackagesPublishReleaseUnlockAndPostNoticeOnPrepareReleasePullReques
236236 gh pr comment $pullRequestNumber `
237237 -- body " I am uploading the packages for `` $tag `` to NuGet and then I will publish the release."
238238
239- nuget push " $artifactDownloadPath /**/*.nupkg" - Source https:// api.nuget.org/ v3/ index.json - ApiKey " $env: NUGET_TOKEN " - SymbolApiKey " $env: NUGET_TOKEN "
239+ dotnet nuget push " $artifactDownloadPath /**/*.nupkg" -- source https:// api.nuget.org/ v3/ index.json -- api - key " $env: NUGET_TOKEN " -- symbol - api - key " $env: NUGET_TOKEN "
240240
241241 if ($LASTEXITCODE -gt 0 )
242242 {
You can’t perform that action at this time.
0 commit comments