-
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (44 loc) · 1.49 KB
/
nuget-deploy.yml
File metadata and controls
51 lines (44 loc) · 1.49 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
name: Nuget Deploy
on:
workflow_dispatch:
jobs:
list-artifacts:
needs: build-and-publish
runs-on: ubuntu-latest
outputs:
artifact-names: ${{ steps.list-outputs.outputs.artifact-names }}
steps:
- name: List artifacts
id: list-outputs
run: |
echo "::set-output name=artifact-names::$(ls artifacts)"
select-artifact:
needs: list-artifacts
runs-on: ubuntu-latest
outputs:
artifact-path: ${{ steps.select-output.outputs.artifact-path }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Download artifact list
uses: actions/download-artifact@v3.0.2
with:
name: artifacts
path: .
- name: Select artifact
id: select-output
run: |
artifact_name=$(echo "${{ needs.list-artifacts.outputs.artifact-names }}" | sed "s/ /\n/g" | fzf --height 10 --reverse --preview "cat artifacts/{}" --preview-window right:70%)
artifact_path="./artifacts/$artifact_name"
echo "::set-output name=artifact-path::$artifact_path"
upload-artifact:
needs: select-artifact
runs-on: ubuntu-latest
steps:
- name: Upload to NuGet
uses: nuget/setup-nuget@v1
with:
nuget-api-key: ${{ secrets.NUGET_API_KEY }}
nuget-version: '5.x'
- name: Upload artifact
run: dotnet nuget push /artifacts/*.nupkg --no-symbols --skip-duplicate --api-key ${{secrets.NUGET_API_KEY}} --source "nuget.org"