-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (41 loc) · 1.59 KB
/
nuget.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
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: Lilikoi.NuGet
on:
push:
branches:
- main
- dev
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
dotnet-quality: 'ga'
- name: Install dependencies
run: dotnet restore
- name: Build Lilikoi
run: dotnet build Lilikoi --framework netstandard2.0 --configuration Release --no-restore
- name: Build Tests
run: dotnet build Lilikoi.Tests --framework net7.0 --configuration Release --no-restore
- name: Test
run: dotnet test Lilikoi.Tests --framework net7.0 --configuration Release --no-build --no-restore --verbosity normal
- name: Pack Lilikoi
run: dotnet pack Lilikoi --configuration Release --no-build --no-restore
- name: Upload package artifacts
uses: actions/upload-artifact@v3
with:
name: nuget_packages
path: ./artifacts/*.nupkg
if-no-files-found: error
- name: Publish to GitHub
run: nuget push ./artifacts/*.nupkg -Source 'https://nuget.pkg.github.com/Mooshua/index.json' -ApiKey ${{secrets.GITHUB_TOKEN}}
- name: Publish to NuGet
run: nuget push ./artifacts/*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_TOKEN}}