-
Notifications
You must be signed in to change notification settings - Fork 2
39 lines (34 loc) · 1.17 KB
/
publish-nuget.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
# This workflow will build a .NET project and publish the nuget file
name: Publish Nuget Package
on:
push:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '6.x'
- name: Determine Version
id: version_step # step id used as reference for output values
uses: gittools/actions/gitversion/[email protected]
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --configuration Release --no-build --verbosity normal
- name: Pack
run: dotnet pack --configuration Release --no-build --output ./nupkg /p:PackageVersion=${{ steps.version_step.outputs.fullSemVer }}
- name: Publish
run: dotnet nuget push "*.nupkg" --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/DFE-Digital/index.json