-
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (42 loc) · 1.51 KB
/
deploy.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
name: Deployment
concurrency:
group: production
cancel-in-progress: true
on:
workflow_run:
workflows: [.NET]
types:
- completed
env:
package_feed: "https://api.nuget.org/v3/index.json"
jobs:
deployment:
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Get run ID of "Build" workflow
id: get-run-id
run: |
REPO_NAME="${{ github.repository }}"
WF_NAME="dotnet.yml"
RUN_ID=`gh run --repo ${REPO_NAME} list --workflow ${WF_NAME} --json databaseId --jq .[0].databaseId`
echo "Detected latest run id of ${RUN_ID} for workflow ${WF_NAME}"
echo "run-id=${RUN_ID}" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ github.token }}
- name: Download artifact from "Build" workflow
uses: actions/download-artifact@v4
with:
name: published_nuget # Match name used in dotnet-core.yml upload artifact step
github-token: ${{ github.token }}
repository: ${{ github.repository }}
run-id: ${{ steps.get-run-id.outputs.run-id }}
- name: Display structure of downloaded files
run: ls -R
- name: publish Nuget Packages to GitHub
run: dotnet nuget push *.nupkg --source ${{env.package_feed}} --api-key ${{secrets.PUBLISH_TO_NUGET}} --skip-duplicate