-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (56 loc) · 2.13 KB
/
master.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Build, Test, and Deploy master to feedz.io
on:
push:
branches:
- master
paths-ignore:
- 'samples/**'
pull_request:
branches:
- master
repository_dispatch:
types:
- deploy
jobs:
build-and-test:
if: github.event_name != 'repository_dispatch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x'
- name: Build
run: dotnet build --configuration Release
- name: Unit Test
run: dotnet test --configuration Release
deploy:
runs-on: ubuntu-latest
needs: build-and-test
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
if: github.event_name != 'repository_dispatch'
- uses: actions/checkout@v1
with:
ref: ${{ github.event.client_payload.ref }}
if: github.event_name == 'repository_dispatch'
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x'
- uses: dotnet/nbgv@master
with:
setAllVars: true
- name: Pack
run: dotnet pack --configuration Release
- name: Push to feedz.io
run: dotnet nuget push **/*.nupkg -k ${{ secrets.FEEDZ_API_KEY }} -s https://f.feedz.io/forevolve/dependencyinjection/nuget/index.json
if: github.event_name == 'pull_request' || (github.event_name == 'repository_dispatch' && github.event.client_payload.feedz == true)
- name: Push to NuGet.org
run: dotnet nuget push **/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
if: github.event_name == 'push' || (github.event_name == 'repository_dispatch' && github.event.client_payload.nuget == true)