-
Notifications
You must be signed in to change notification settings - Fork 31
42 lines (36 loc) · 1.62 KB
/
release.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
name: Publish .NET packages on GitHub and NuGet
on:
release:
types: [published]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-22.04
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
# Install .NET environment
- name: Set up .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6
# Build DSF
- name: Build DSF packages
run: |
cd src
dotnet restore
dotnet build
# Publish packages
- name: Publish packages
run: |
# Publish to GitHub package registry
dotnet nuget push src/DuetAPI/bin/Debug/DuetAPI.*.nupkg --source "https://nuget.pkg.github.com/Duet3D/index.json" --api-key $GH_API_KEY
dotnet nuget push src/DuetAPIClient/bin/Debug/DuetAPIClient.*.nupkg --source "https://nuget.pkg.github.com/Duet3D/index.json" --api-key $GH_API_KEY
dotnet nuget push src/DuetHttpClient/bin/Debug/DuetHttpClient.*.nupkg --source "https://nuget.pkg.github.com/Duet3D/index.json" --api-key $GH_API_KEY
# Publish to NuGet package registry
dotnet nuget push src/DuetAPI/bin/Debug/DuetAPI.*.nupkg --source "nuget.org" --api-key $NUGET_API_KEY
dotnet nuget push src/DuetAPIClient/bin/Debug/DuetAPIClient.*.nupkg --source "nuget.org" --api-key $NUGET_API_KEY
dotnet nuget push src/DuetHttpClient/bin/Debug/DuetHttpClient.*.nupkg --source "nuget.org" --api-key $NUGET_API_KEY
env:
GH_API_KEY: ${{ secrets.GH_API_KEY }}
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}