-
Notifications
You must be signed in to change notification settings - Fork 8
74 lines (60 loc) · 1.48 KB
/
dotnetcore.yml
File metadata and controls
74 lines (60 loc) · 1.48 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: .NET Core
on:
push:
branches:
- main
pull_request:
branches:
- main
release:
types:
- published
env:
solution: ./dirs.proj
config: Release
ContinuousIntegrationBuild: "true"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
global-json-file: global.json
- name: Restore
run: dotnet restore $solution
- name: Build
run: dotnet build $solution --configuration $config --no-restore
- name: Test
run: dotnet test $solution --configuration $config --no-build
- name: Pack
run: dotnet pack $solution --configuration $config --no-build
- name: Upload
uses: actions/upload-artifact@v3
with:
name: pkg
path: ./out/pkg
release:
needs: build
if: github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- name: Download Build Artifact
uses: actions/download-artifact@v4.1.7
with:
name: pkg
path: pkg
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
7.0.x
- name: Push Nuget
env:
NUGET_API: ${{ secrets.NUGET_API }}
run: dotnet nuget push pkg/**/*.nupkg
--api-key $NUGET_API
--source https://api.nuget.org/v3/index.json