File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111 permissions :
1212 contents : write
1313 packages : write
14-
14+ id-token : write # required for OIDC token issuance (Trusted Publishing)
15+
1516 steps :
1617 - name : Checkout
1718 uses : actions/checkout@v4
2627 - name : Restore dependencies
2728 run : dotnet restore
2829
29- - name : Build and create NuGet package
30- run : dotnet pack DevMaid.CLI/DevMaid.CLI.csproj -c Release --no-restore
30+ - name : Build
31+ run : dotnet build DevMaid.CLI/DevMaid.CLI.csproj -c Release --no-restore
32+
33+ - name : Create NuGet package
34+ run : dotnet pack DevMaid.CLI/DevMaid.CLI.csproj -c Release --no-build --no-restore
3135
3236 - name : Extract version
3337 id : version
@@ -37,10 +41,14 @@ jobs:
3741 echo "version=$version" >> $env:GITHUB_OUTPUT
3842 shell : pwsh
3943
44+ - name : NuGet login (Trusted Publishing)
45+ uses : NuGet/login@v1
46+ id : nuget-login
47+ with :
48+ user : ${{ secrets.NUGET_USER }}
49+
4050 - name : Publish to NuGet.org
41- run : dotnet nuget push DevMaid.CLI/bin/Release/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}
42- env :
43- NUGET_AUTH_TOKEN : ${{ secrets.NUGET_API_KEY }}
51+ run : dotnet nuget push DevMaid.CLI/bin/Release/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ steps.nuget-login.outputs.NUGET_API_KEY }}
4452
4553 - name : Create GitHub Release
4654 if : github.event_name == 'workflow_dispatch'
You can’t perform that action at this time.
0 commit comments