-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (61 loc) · 1.81 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# ------------------------------------------------------------------------------
# <auto-generated>
#
# This code was generated.
#
# - To turn off auto-generation set:
#
# [PublishNugetPackagesJob (AutoGenerate = false)]
#
# - To trigger manual generation invoke:
#
# nuke --generate-configuration GitHubActions_publish-nuget --host GitHubActions
#
# </auto-generated>
# ------------------------------------------------------------------------------
name: Publish Nuget Packages
on:
workflow_run:
workflows:
- 'ci'
types:
- 'completed'
permissions:
actions: read
checks: read
contents: read
deployments: read
id-token: none
issues: write
discussions: none
packages: none
pages: none
pull-requests: write
repository-projects: none
security-events: none
statuses: write
jobs:
publish_nuget:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: '${{ toJson(github) }}'
shell: pwsh
run: |
echo "$GITHUB_CONTEXT"
- name: 🚀 NuGet
uses: actions/download-artifact@v4
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'
name: 'nuget'
run-id: '${{ github.event.workflow_run.id }}'
- name: nuget.org
env:
ApiKey: '${{ secrets.RSG_NUGET_API_KEY }}'
if: startsWith(github.event.workflow_run.head_branch, 'v') && contains(github.event.workflow_run.head_branch, '.') && !contains(github.event.workflow_run.head_branch, '/')
shell: pwsh
run: |
dotnet nuget push **/*.nupkg --skip-duplicate -s nuget.org --api-key $ENV:ApiKey
dotnet nuget push **/*.snupkg --skip-duplicate -s nuget.org --api-key $ENV:ApiKey