-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (35 loc) · 1.35 KB
/
Copy pathpublish.yml
File metadata and controls
37 lines (35 loc) · 1.35 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
name: Publish to Nuget
on:
workflow_dispatch:
release:
types: [ published ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write # enable GitHub OIDC token issuance for this job
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: 9.0.x
- name: Build
run: dotnet build Platy.AdventureWorks.Repository.sln --configuration Release
- name: Test
env:
ADVENTUREWORKSDB: ${{ secrets.ADVENTUREWORKSDB }}
run: dotnet test Platy.AdventureWorks.Repository.sln --configuration Release --no-build --no-restore
- name: Pack
run: dotnet pack Platy.AdventureWorks.Repository.sln --configuration Release --no-build --no-restore --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 }} # Recommended: use a secret like ${{ secrets.NUGET_USER }} for your nuget.org username (profile name), NOT your email address
- name: Push to NuGet
run: dotnet nuget push "*.nupkg" --api-key ${{steps.login.outputs.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json --skip-duplicate