Skip to content

Commit 1f7610d

Browse files
Merge pull request #12 from TimeWarpEngineering/dev
feat: publish via NuGet Trusted Publishing (OIDC)
2 parents fea5afe + 408d27c commit 1f7610d

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

.github/workflows/workflow.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ on:
2828
jobs:
2929
ci:
3030
runs-on: ubuntu-latest
31+
permissions:
32+
contents: read
33+
id-token: write # Required for NuGet Trusted Publishing (OIDC)
3134

3235
steps:
3336
- name: Checkout repository
@@ -40,10 +43,17 @@ jobs:
4043
with:
4144
dotnet-version: '10.0.x'
4245

46+
- name: NuGet login (OIDC Trusted Publishing)
47+
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
48+
id: nuget-login
49+
uses: nuget/login@v1
50+
with:
51+
user: TimeWarp.Enterprises
52+
4353
- name: Run CI Pipeline
4454
run: |
4555
if [ "${{ github.event_name }}" == "release" ] || [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
46-
dotnet run --file tools/dev-cli/dev.cs -- workflow --api-key "${{ secrets.PUBLISH_TO_NUGET_ORG }}"
56+
dotnet run --file tools/dev-cli/dev.cs -- workflow --api-key "${{ steps.nuget-login.outputs.NUGET_API_KEY }}"
4757
else
4858
dotnet run --file tools/dev-cli/dev.cs -- workflow
4959
fi

0 commit comments

Comments
 (0)