-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (47 loc) · 1.63 KB
/
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
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Publish NuGet Package
on:
push:
branches:
- development
workflow_dispatch:
jobs:
publish:
name: Publish NuGet Package
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0'
- name: Restore dependencies
run: dotnet restore ./RoveComm/RoveComm.csproj
- name: Build project
run: dotnet build ./RoveComm/RoveComm.csproj --configuration Release
- name: Pack NuGet Package
run: dotnet pack ./RoveComm/RoveComm.csproj --configuration Release --output ./output
- name: Publish to GitHub Packages
id: publish_github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
dotnet nuget push "./output/RoveComm.*.nupkg" \
--source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" \
--symbol-source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" \
--api-key $GITHUB_TOKEN \
--skip-duplicate
- name: Publish to NuGet.org
id: publish_nuget
if: steps.publish_github.conclusion != 'cancelled'
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: |
dotnet nuget push "./output/RoveComm.*.nupkg" \
--source "https://api.nuget.org/v3/index.json" \
--symbol-source "https://nuget.smbsrc.net/" \
--api-key $NUGET_API_KEY \
--skip-duplicate