-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (64 loc) · 2.18 KB
/
main.yml
File metadata and controls
79 lines (64 loc) · 2.18 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
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
70
71
72
73
74
75
76
77
78
79
name: Build, Test, and Deploy
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
DOTNET_2_VERSION: '2.1.x'
DOTNET_3_VERSION: '3.1.x'
DOTNET_5_VERSION: '5.0.x'
DOTNET_6_VERSION: '6.0.x'
BUILD_CONFIGURATION: Release
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dotnet: ['6.0.x']
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ matrix.dotnet }}
include-prerelease: true
- name: Restore
run: dotnet restore
- name: Build
run: dotnet build --configuration ${{ env.BUILD_CONFIGURATION }} --no-restore
- name: Unit Test
run: dotnet test --configuration ${{ env.BUILD_CONFIGURATION }} --no-build
deploy:
runs-on: ubuntu-latest
needs: build-and-test
strategy:
fail-fast: true
matrix:
dotnet: ['6.0.x']
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ matrix.dotnet }}
include-prerelease: true
- uses: dotnet/nbgv@master
with:
setAllVars: true
- name: Pack
run: dotnet pack --configuration ${{ env.BUILD_CONFIGURATION }}
- name: Push to feedz.io
run: dotnet nuget push **/*.nupkg -k ${{ secrets.FEEDZ_API_KEY }} -s https://f.feedz.io/forevolve/eztelemetry/nuget/index.json
# if: github.event_name == 'pull_request'
# - 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'