-
Notifications
You must be signed in to change notification settings - Fork 11
40 lines (37 loc) · 1.04 KB
/
CI build.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
name: CI build
on:
push:
branches: [ master ]
pull_request:
release:
types: [ published ]
jobs:
test:
name: Test
runs-on: windows-latest # So we can test against .NET Framework as well
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup dotnet
uses: actions/setup-dotnet@v2
with:
# This should match the .NET versions in Moq.Contrib.HttpClient.Test.csproj
dotnet-version: |
3.1.x
6.0.x
7.0.x
include-prerelease: true
- name: Test
run: dotnet test -v normal
publish:
name: Publish
if: github.event_name == 'release'
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Pack
run: dotnet pack Moq.Contrib.HttpClient -c Release -p:Version=${GITHUB_REF#refs/tags/v} -o .
- name: Push to NuGet
run: dotnet nuget push Moq.Contrib.HttpClient.*.nupkg -k ${{secrets.NUGET_KEY}} -s https://api.nuget.org/v3/index.json