11name : NuGet Package
22
3- on :
3+ on :
44 push :
55 tags :
66 - ' *'
@@ -11,36 +11,27 @@ jobs:
1111 runs-on : windows-latest
1212
1313 steps :
14- - uses : actions/checkout@v1
14+ - uses : actions/checkout@v5
1515
1616 - name : Setup .NET
17- uses : actions/setup-dotnet@v1
18- with :
19- dotnet-version : |
20- 8.0.x
21- 9.0.x
17+ uses : actions/setup-dotnet@v5
2218
2319 - name : Install dotnet tool
2420 run : dotnet tool install -g dotnetCampus.TagToVersion
2521
26- - name : Set tag to version
22+ - name : Set tag to version
2723 run : dotnet TagToVersion -t ${{ github.ref }}
2824
2925 - name : Build with dotnet
3026 run : |
3127 dotnet build -c release
3228 dotnet pack ./src/DotNetCampus.WeChatWork -c release --no-build
3329
34- - name : Install Nuget
35- uses : nuget/setup-nuget@v1
36- with :
37- nuget-version : ' 6.x'
38-
39- - name : Add private GitHub registry to NuGet
40- run : |
41- nuget sources add -name github -Source https://nuget.pkg.github.com/dotnet-campus/index.json -Username dotnet-campus -Password ${{ secrets.GITHUB_TOKEN }}
42-
43- - name : Push generated package to GitHub registry
30+ - name : Publish
4431 run : |
45- nuget push .\artifacts\package\release\*.nupkg -Source github -SkipDuplicate
46- nuget push .\artifacts\package\release\*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NugetKey }}
32+ dotnet nuget push ".\artifacts\package\release\*.nupkg" \
33+ --api-key ${{ secrets.GITHUB_TOKEN }} \
34+ --source https://nuget.pkg.github.com/${{ github.repository_owner }}
35+ dotnet nuget push ".\artifacts\package\release\*.nupkg" \
36+ --api-key ${{ secrets.NugetKey }} \
37+ --source https://api.nuget.org/v3/index.json
0 commit comments