-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (40 loc) · 1.66 KB
/
Copy pathdotnet.yml
File metadata and controls
50 lines (40 loc) · 1.66 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
######################################################################
# This workflow will build the Shared.Databases of #
# Peereflits #
######################################################################
name: 'Build, test and publish Peereflits.Shared.Databases'
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
API_KEY : ${{ secrets.PAT_CLASSIC }}
DOTNET_SOLUTION: src/Peereflits.Shared.Databases.sln
jobs:
build-and-test:
name: Build & test & publish
runs-on: ubuntu-latest
env:
ASPNETCORE_ENVIRONMENT : Test
steps:
- uses: actions/checkout@v5
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x
- name: Restore and build
run: |
dotnet restore ${{ env.DOTNET_SOLUTION }}
dotnet build ${{ env.DOTNET_SOLUTION }} --configuration Release --no-restore
# Category==Integration requires an active database in the build pipeline
- name: Run unit tests
run: dotnet test ${{ env.DOTNET_SOLUTION }} --configuration Release --no-restore --no-build --filter "Category!=Integration" --verbosity normal
- name: Pack & Push
run: |
dotnet pack ${{ env.DOTNET_SOLUTION }} --configuration Release --no-build --no-restore
dotnet nuget add source --username peereflits --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/peereflits/index.json"
dotnet nuget push **/*.nupkg --api-key ${{ env.API_KEY }} --skip-duplicate --source github