-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (36 loc) · 1.09 KB
/
Copy pathpublish.yml
File metadata and controls
44 lines (36 loc) · 1.09 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
43
44
name: Publish NuGet Package
on:
workflow_call:
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
- name: Build and test
working-directory: ./src/Devity.NETCore.MailKit
run: |
dotnet build --configuration Release
# dotnet test --configuration Release --no-build
- name: Package
working-directory: ./src/Devity.NETCore.MailKit
run: dotnet pack --configuration Release --no-build
- name: NuGet login (OIDC -> short-lived API key)
uses: NuGet/login@v1
id: login
with:
user: rese-sw
- name: Publish
working-directory: ./src/Devity.NETCore.MailKit
run: |
cd bin/Release
dotnet nuget push *.nupkg --api-key ${{ steps.login.outputs.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json