-
-
Notifications
You must be signed in to change notification settings - Fork 62
48 lines (37 loc) · 1.04 KB
/
ci.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
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
env:
BUILD_CONFIG: 'Release'
SOLUTION: 'DbfDataReader.sln'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Build
run: dotnet build $SOLUTION --configuration $BUILD_CONFIG
- name: Run tests
run: dotnet test /p:Configuration=$BUILD_CONFIG --no-restore --no-build --verbosity normal
- name: Pack
run: dotnet pack --output ./artifacts --configuration $BUILD_CONFIG --no-build
- name: Push to MyGet
if: github.ref == 'refs/heads/main'
env:
NUGET_URL: ${{ secrets.MYGET_URL }}
NUGET_API_KEY: ${{ secrets.MYGET_API_KEY }}
run: dotnet nuget push ./artifacts/**.nupkg --source $NUGET_URL --api-key $NUGET_API_KEY
- name: Artifacts
uses: actions/upload-artifact@v2
with:
name: artifacts
path: artifacts/**/*