-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (30 loc) · 1.07 KB
/
Copy pathpublish-nuget.yml
File metadata and controls
34 lines (30 loc) · 1.07 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
# This workflow is triggered when a GitHub release is created.
# It can also be run manually to re-publish to NuGet in case it failed for some reason.
# You can run this workflow by navigating to https://www.github.com/sd-st/publishing-test-csharp/actions/workflows/publish-nuget.yml
name: Publish to NuGet
on:
workflow_dispatch:
release:
types: [published]
jobs:
publish:
name: publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
- name: Build and pack
run: dotnet pack
--configuration Release
--output "${{github.workspace}}/artifacts/packages"
- name: Publish package to nuget.org
run: dotnet nuget push
${{ github.workspace }}/artifacts/packages/*.nupkg
--source https://api.nuget.org/v3/index.json
--api-key $NUGET_API_KEY
--skip-duplicate
env:
NUGET_API_KEY: ${{ secrets.PUBLISHING_TEST_NUGET_API_KEY || secrets.NUGET_API_KEY }}