File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010 branches : [ main ]
1111 workflow_dispatch :
1212
13+ permissions :
14+ id-token : write # required for GitHub OIDC
15+
1316jobs :
1417 build-and-test :
1518 name : Build and Test (${{ matrix.os }})
99102 if : startsWith(github.ref, 'refs/tags/v')
100103 permissions :
101104 contents : read
105+ id-token : write # required for OIDC Trusted Publishing
102106
103107 steps :
104108 - name : Checkout
@@ -125,7 +129,11 @@ jobs:
125129 $version = "${{ github.ref_name }}" -replace '^v', ''
126130 dotnet pack src/CDT.Core/CDT.Core.csproj --no-build -c Release -o ./artifacts /p:Version=$version
127131
132+ - name : NuGet login
133+ uses : NuGet/login@v1
134+ id : login
135+ with :
136+ user : MichaConrad
137+
128138 - name : Push to NuGet.org
129- # Requires a NUGET_API_KEY secret configured in:
130- # GitHub → Repository Settings → Secrets and variables → Actions → New repository secret
131- run : dotnet nuget push ./artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
139+ run : dotnet nuget push ./artifacts/*.nupkg --api-key ${{ steps.login.outputs.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
You can’t perform that action at this time.
0 commit comments