-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (55 loc) · 1.61 KB
/
dotnet.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
57
58
59
name: .NET
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore /p:EnableWindowsTargeting=true
- name: Build
run: dotnet build --no-restore /p:EnforceCodeStyleInBuild=true /p:EnableWindowsTargeting=true
- name: Test
run: dotnet test --no-build --verbosity normal
build-packages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Build package
run: dotnet build src/FunctionalInterfaces/FunctionalInterfaces.csproj -c Release
- name: Upload package artifacts
uses: actions/upload-artifact@v3
with:
name: Packages
path: src/FunctionalInterfaces/bin/Release/*.nupkg
if-no-files-found: error
publish-github:
needs: [build, build-packages]
runs-on: ubuntu-latest
if: ${{github.event_name == 'push'}}
steps:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- uses: actions/download-artifact@v3
with:
name: Packages
path: artifacts
- run: dotnet nuget push "artifacts/*.nupkg" --source "https://nuget.pkg.github.com/${{github.repository_owner}}/index.json" --api-key ${{secrets.GITHUB_TOKEN}}