-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (55 loc) · 2.39 KB
/
publish-nuget.yml
File metadata and controls
64 lines (55 loc) · 2.39 KB
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
name: Publish Nuget
on:
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@v2
if: github.event.workflow_run.conclusion == 'success'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: ci.yml
run_id: ${{ github.event.id }}
name: nuget
# - uses: actions/download-artifact@v2
# with:
# 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
dotnet nuget push **/*.snupkg --skip-duplicate -s nuget.org --api-key $ENV:ApiKey
- name: dev.azure.com
# continue-on-error: true
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
env:
ApiKey: ${{ secrets.RSG_AZURE_DEVOPS }}
shell: pwsh
run: |
dotnet nuget add source https://rocketsurgeonsguild.pkgs.visualstudio.com/Libraries/_packaging/Packages/nuget/v3/index.json --store-password-in-clear-text --name LibrariesPackages --username azuredevops --password $ENV:ApiKey
dotnet nuget push **/*.nupkg --skip-duplicate --api-key azuredevops --source LibrariesPackages
- name: preview.dev.azure.com
# continue-on-error: true
if: github.ref != 'refs/heads/master' && github.ref != 'refs/heads/main'
env:
ApiKey: ${{ secrets.RSG_AZURE_DEVOPS }}
shell: pwsh
run: |
dotnet nuget add source https://rocketsurgeonsguild.pkgs.visualstudio.com/Libraries/_packaging/Preview/nuget/v3/index.json --store-password-in-clear-text --name LibrariesPreview --username azuredevops --password $ENV:ApiKey
dotnet nuget push **/*.nupkg --skip-duplicate --api-key azuredevops --source LibrariesPreview