-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (36 loc) · 1.08 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
name: Build
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: 1
NUGET_AUTH_TOKEN: ${{ secrets.PACKAGE_REGISTRY_TOKEN }}
on:
push:
branches: '*'
pull_request:
branches: 'main'
defaults:
run:
working-directory: src
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
source-url: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
- name: Restore
run: dotnet restore
- name: Test
run: dotnet test --no-restore --verbosity normal
- name: Pack
run: dotnet pack --no-restore -c:Release
- name: Push
# Push packages into private github repository
if: github.ref == 'refs/heads/main'
run: dotnet nuget push "../bin/Release/*.nupkg" -k ${{ secrets.PACKAGE_REGISTRY_TOKEN }} -s https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json --skip-duplicate