-
-
Notifications
You must be signed in to change notification settings - Fork 18
61 lines (59 loc) · 1.88 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Build
on:
push:
pull_request:
release:
types:
- published
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'
- name: Determine Version
uses: gittools/actions/gitversion/[email protected]
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.201
- name: Restore
run: dotnet restore
- name: Build
run: dotnet build -c Release --no-restore -p:Version=$GITVERSION_NUGETVERSION
- name: Test
run: dotnet test -c Release --no-restore
- name: Pack
run: dotnet pack -v normal -c Release --no-restore --include-symbols --include-source -p:Version=$GITVERSION_NUGETVERSION -o ./artifacts
- name: Push to MyGet
run: dotnet nuget push ./artifacts/*.nupkg --source https://www.myget.org/F/aisparser/api/v3/index.json --api-key ${{ secrets.MYGET_API_KEY }}
- name: Artifacts
uses: actions/upload-artifact@v2
with:
name: artifacts
path: artifacts/**/*
deploy:
needs: build
if: github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.201
- name: Push to NuGet Feed
env:
NUGET_URL: https://api.nuget.org/v3/index.json
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: dotnet nuget push ./artifacts/*.nupkg --source $NUGET_URL --skip-duplicate --api-key $NUGET_API_KEY