-
Notifications
You must be signed in to change notification settings - Fork 7
44 lines (40 loc) · 1.5 KB
/
nuget-publish.yml
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
# This workflow will publish a package when a release is created
name: Publish package to NuGet repository
on:
release:
types: [created]
jobs:
publish-nuget:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v1
- name: Setup .NET Core @ Latest
uses: actions/setup-dotnet@v3
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_AUTH_TOKEN }}
- name: Build solution and generate NuGet package
run: |
dotnet pack -c Release -o out
- name: Push generated package to GitHub registry
run: |
cd out
dotnet nuget push "contentstack.csharp.*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate --no-symbols true --source https://api.nuget.org/v3/index.json
publish-git:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v1
- name: Setup .NET Core @ Latest
uses: actions/setup-dotnet@v3
with:
source-url: https://nuget.pkg.github.com/Contentstack/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build solution and generate NuGet package
run: |
dotnet pack -c Release -o out
- name: Push generated package to GitHub registry
run: |
cd out
dotnet nuget push "contentstack.csharp.*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate --no-symbols true --source https://api.nuget.org/v3/index.json