-
Notifications
You must be signed in to change notification settings - Fork 10
45 lines (35 loc) · 1.15 KB
/
build-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
name: BuildAndPublish
on:
push:
branches: [ master ]
paths-ignore:
- '.github/**'
workflow_dispatch:
jobs:
build:
env:
BUILD_CONFIG: 'Release'
SOLUTION: 'RecurrenceCalculator.sln'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup NuGet
uses: NuGet/[email protected]
with:
nuget-version: latest
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.*
- name: Restore dependencies
working-directory: ./RecurrenceCalculator
run: dotnet restore $SOLUTION
- name: Build
working-directory: ./RecurrenceCalculator
run: dotnet build $SOLUTION --configuration $BUILD_CONFIG --no-restore
- name: Run tests
working-directory: ./RecurrenceCalculator
run: dotnet test $SOLUTION --configuration $BUILD_CONFIG --no-restore --no-build --verbosity normal
- name: Push to nuget
working-directory: ./RecurrenceCalculator
run: dotnet nuget push **/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}}