-
Notifications
You must be signed in to change notification settings - Fork 0
28 lines (27 loc) · 1.02 KB
/
nuget.yml
File metadata and controls
28 lines (27 loc) · 1.02 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
name: publish to nuget
on:
push:
tags:
- '*.*.*'
jobs:
publish:
name: build, pack & publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Restore and Build
run: |
dotnet restore PhysicsFormulas/Source/PhysicsFormulas/PhysicsFormulas.csproj
dotnet build --configuration Release PhysicsFormulas/Source/PhysicsFormulas/PhysicsFormulas.csproj
- name: Test the project
run: dotnet test PhysicsFormulas/Test/PhysicsFormulasUnitTests/PhysicsFormulasUnitTests.csproj
- name: publish to nuget
env:
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
run: |
dotnet pack --configuration Release PhysicsFormulas/Source/PhysicsFormulas/PhysicsFormulas.csproj --output Nuget
dotnet nuget push "Nuget/**.nupkg" --source "https://api.nuget.org/v3/index.json" --api-key ${NUGET_KEY}