Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ name: release
# Cutting a release:
# git tag v1.0.0 && git push origin v1.0.0
#
# The tag is the single source of truth for the published version. Requires a NUGET_API_KEY
# repository secret with push rights for the DependencyModules.* package IDs on nuget.org.
# The tag is the single source of truth for the published version. The push to nuget.org uses
# trusted publishing: a policy on nuget.org names this repository and release.yaml, and the
# NUGET_USER repository secret holds the nuget.org account that owns the policy.

on:
push:
Expand All @@ -18,6 +19,8 @@ on:
permissions:
contents: write
packages: write
# nuget.org trusted publishing exchanges the workflow's OIDC token for a push key.
id-token: write

jobs:
release:
Expand Down Expand Up @@ -104,10 +107,19 @@ jobs:
name: packages
path: ./artifacts/*

# The key lasts one hour.
- name: Get a nuget.org push key
id: nuget
uses: NuGet/login@v1
with:
user: ${{ secrets.NUGET_USER }}

- name: Push to nuget.org
env:
NUGET_API_KEY: ${{ steps.nuget.outputs.NUGET_API_KEY }}
run: |
dotnet nuget push "./artifacts/*.nupkg" \
--api-key "${{ secrets.NUGET_API_KEY }}" \
--api-key "$NUGET_API_KEY" \
--source https://api.nuget.org/v3/index.json \
--skip-duplicate

Expand Down
Loading