File tree Expand file tree Collapse file tree 2 files changed +42
-2
lines changed
Expand file tree Collapse file tree 2 files changed +42
-2
lines changed Original file line number Diff line number Diff line change 1+ name : Publish Packages
2+
3+ on :
4+ push :
5+ tags :
6+ - " v*"
7+ workflow_dispatch :
8+
9+ permissions :
10+ id-token : write
11+ contents : read
12+
13+ jobs :
14+ publish :
15+ runs-on : ubuntu-latest
16+
17+ steps :
18+ - name : Checkout
19+ uses : actions/checkout@v4
20+
21+ - name : Setup .NET
22+ uses : actions/setup-dotnet@v4
23+ with :
24+ dotnet-version : |
25+ 10.0.x
26+
27+ - name : Install Cake
28+ run : dotnet tool restore
29+
30+ - name : NuGet login (OIDC)
31+ uses : NuGet/login@v1
32+ id : login
33+ with :
34+ user : ${{ secrets.NUGET_USER }}
35+
36+ - name : Run Cake Publish target
37+ run : dotnet cake --target=Publish --nugetApiKey=${{ steps.login.outputs.apikey }}
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ var configuration = Argument("configuration", "Release");
99var netfx = Argument( "netfx" , "net472" ) ;
1010var netcore = Argument( "netcore" , "net8.0" ) ;
1111var netcoreVersion = Argument( "netcoreVersion" , "" ) ;
12+ var nugetApiKey = Argument( "nugetApiKey" , "" ) ;
1213
1314//////////////////////////////////////////////////////////////////////
1415// CONSTANTS
@@ -245,9 +246,11 @@ Task("Publish")
245246{
246247 foreach ( var package in System . IO . Directory . GetFiles ( PACKAGE_DIR , "*.nupkg" ) . Where ( o => ! o . Contains ( "symbols" ) ) )
247248 {
248- NuGetPush ( package , new NuGetPushSettings ( )
249+ DotNetNuGetPush ( package , new DotNetNuGetPushSettings ( )
249250 {
250- Source = "https://api.nuget.org/v3/index.json"
251+ Source = "https://api.nuget.org/v3/index.json" ,
252+ ApiKey = nugetApiKey ,
253+ SkipDuplicate = true
251254 } ) ;
252255 }
253256} ) ;
You can’t perform that action at this time.
0 commit comments