-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (36 loc) · 1.11 KB
/
publish-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
41
42
name: Publish Nuget
on:
push:
branches:
- master
workflow_run:
workflows: ['ci']
types:
- completed
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: nuget/setup-nuget@v1
with:
nuget-version: '5.x'
- name: Download artifact
uses: dawidd6/action-download-artifact@v6
if: github.event.workflow_run.conclusion == 'success'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: ci.yml
run_id: ${{ github.event.id }}
name: nuget
- name: nuget.org
# continue-on-error: true
if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main') && startsWith(github.event.workflow_run.head_branch, 'v') # this is the best approximation for a tag
env:
ApiKey: ${{ secrets.RSG_NUGET_API_KEY }}
shell: pwsh
run: |
dotnet nuget push **/*.nupkg --skip-duplicate -s nuget.org --api-key $ENV:ApiKey