-
Notifications
You must be signed in to change notification settings - Fork 22
42 lines (34 loc) · 1.16 KB
/
nuget-cli.yml
File metadata and controls
42 lines (34 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Publish UUIDNext.Cli to NuGet
on: workflow_dispatch
defaults:
run:
working-directory: Src
permissions:
id-token: write # required for Nuget Trusted Publishing
jobs:
publish:
runs-on: ubuntu-latest
permissions:
id-token: write # enable GitHub OIDC (OpenID Connect standard) token issuance for this job
steps:
- uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build -c Release --no-restore
- name: Test
run: dotnet test -c Release --no-build --framework net10.0
- name: Pack nugets
run: dotnet pack "./UUIDNext.Cli/UUIDNext.Cli.csproj" -c Release --no-build --output .
# Get a short-lived NuGet API key
- name: NuGet login (OIDC → temp API key)
uses: NuGet/login@v1
id: login
with:
user: ${{ secrets.NUGET_USER }}
- name: Push to NuGet
run: dotnet nuget push "UUIDNext.Cli.*.nupkg" --api-key ${{steps.login.outputs.NUGET_API_KEY}} --skip-duplicate --source https://api.nuget.org/v3/index.json