-
Notifications
You must be signed in to change notification settings - Fork 66
40 lines (35 loc) · 1.15 KB
/
release-nuget.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
name: Release NuGet
on:
release:
types: [published]
workflow_dispatch:
inputs:
runId:
description: "The run id of the GitHub Action Run to publish artifacts from"
required: false
default: '-1'
jobs:
nuget-publish:
runs-on: windows-latest
steps:
- name: Download specific artifact
if: ${{ github.event.inputs.runId > 0 }}
uses: dawidd6/action-download-artifact@v2
with:
workflow: build.yml
branch: main
run_id: ${{ github.event.inputs.runId }}
- name: Download latest artifact
if: ${{ github.event.inputs.runId == -1 }}
uses: dawidd6/action-download-artifact@v2
with:
workflow: build.yml
branch: main
- shell: pwsh
name: Publish NuGet Package
run: dotnet nuget push **/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
- shell: pwsh
name: Publish NuGet Package (GitHub)
run: |
dotnet nuget add source "https://nuget.pkg.github.com/redth-org/index.json" -n "Github" -u redth-org -p ${{ secrets.GITHUB_TOKEN }}
dotnet nuget push **/*.nupkg -s "Github" -n true