-
Notifications
You must be signed in to change notification settings - Fork 9
51 lines (43 loc) · 1.37 KB
/
publish.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
name: Packages publication
on:
release:
types: [published]
env:
nuget_directory: ${{ github.workspace}}/artifacts
jobs:
create:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.x
8.x
- name: Build
run: dotnet build -c Release
- name: Pack
run: dotnet pack -c Release -o ${{ env.nuget_directory }}
- name: Display created package files
run: ls -R ${{ env.nuget_directory }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: nuget_packages
path: ${{ env.nuget_directory }}/*.nupkg
if-no-files-found: error
publish:
runs-on: ubuntu-latest
needs: [create]
steps:
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v4
- uses: actions/download-artifact@v4
with:
name: nuget_packages
path: ${{ env.nuget_directory }}
- name: Display prepared package files
run: ls -R ${{ env.nuget_directory }}
- name: Publish all packages to NuGet
run: dotnet nuget push ${{ env.nuget_directory }}/*.nupkg --api-key "${{ secrets.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate