-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (35 loc) · 1.3 KB
/
master..yml
File metadata and controls
46 lines (35 loc) · 1.3 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
name: Action to build and publish the project as a nuget package to github package registry
on:
push:
branches: [master]
jobs:
build:
name: publish-release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v3.0.3
with:
dotnet-version: 8.0.x
# Authenticates packages to push to GPR
source-url: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_PACKAGE_TOKEN }}
- name: Install dependencies
run: dotnet restore
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_PACKAGE_TOKEN }}
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --no-restore --verbosity normal
- name: Pack
run: dotnet pack --no-build --configuration Release
- name: PushNuget
run: dotnet nuget push **/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_PACKAGE_TOKEN }} --skip-duplicate
- name: PushGithub
run: dotnet nuget push **/*.nupkg --no-symbols --skip-duplicate
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_PACKAGE_TOKEN }}