-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (35 loc) · 1.38 KB
/
nuget-publish.yml
File metadata and controls
46 lines (35 loc) · 1.38 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
name: Publish NuGet Packages
on:
push:
branches:
- master
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
defaults:
run:
working-directory: ./src
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore
run: dotnet restore Disc.NET.sln
- name: Build package version
shell: bash
run: |
VERSION="1.0.${{ github.run_number }}"
echo "PACKAGE_VERSION=$VERSION" >> "$GITHUB_ENV"
- name: Pack Disc.NET.Client.SDK
run: dotnet pack ./Disc.NET.Client.SDK/Disc.NET.Client.SDK.csproj --configuration Release --no-restore --output ./artifacts -p:Version=${{ env.PACKAGE_VERSION }}
- name: Pack Disc.NET.Commands
run: dotnet pack ./Disc.NET.Commands/Disc.NET.Commands.csproj --configuration Release --no-restore --output ./artifacts -p:Version=${{ env.PACKAGE_VERSION }}
- name: Pack Disc.NET
run: dotnet pack ./Disc.NET/Disc.NET.csproj --configuration Release --no-restore --output ./artifacts -p:Version=${{ env.PACKAGE_VERSION }}
- name: Publish to NuGet
run: dotnet nuget push "./artifacts/*.nupkg" --api-key "${{ secrets.NUGET_API_KEY }}" --source "https://api.nuget.org/v3/index.json" --skip-duplicate