-
Notifications
You must be signed in to change notification settings - Fork 1
31 lines (29 loc) · 1.13 KB
/
publish-package.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
name: IBI.WZDx NuGet Package
on:
push:
branches:
- main
- develop
pull_request:
branches:
- develop
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
- name: Build
run: dotnet build --configuration Release
- name: Run unit tests
run: dotnet test --configuration Release --no-build tests/IBI.WZDx.UnitTests/IBI.WZDx.UnitTests.csproj
- name: Pack IBI.WZDx NuGet package (pre-release)
if: ${{ github.ref != 'refs/heads/main' }}
run: dotnet pack --configuration Release --no-build --version-suffix preview.${{ github.run_number }} src/IBI.WZDx/IBI.WZDx.csproj
- name: Pack IBI.WZDx NuGet package (stable)
if: ${{ github.ref == 'refs/heads/main' }}
run: dotnet pack --configuration Release --no-build src/IBI.WZDx/IBI.WZDx.csproj
- name: Push IBI.WZDx NuGet package to nuget.org
run: dotnet nuget push src/IBI.WZDx/bin/Release/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}