-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (65 loc) · 1.9 KB
/
Copy pathbuild.yml
File metadata and controls
79 lines (65 loc) · 1.9 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
75
76
77
78
79
name: CI
on:
push:
branches: [ master ]
tags: [ 'v*' ]
pull_request:
branches: [ master ]
jobs:
build:
name: Build & Test
runs-on: ubuntu-latest
permissions:
checks: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Check for unresolved merge conflict markers
run: |
if grep -rIn --exclude-dir=.git -E '^(<{7}|={7}|>{7})( |$)' .; then
echo "::error::Unresolved merge conflict markers found (see above)."
exit 1
fi
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.x
9.x
10.0.x
- name: Restore
run: dotnet restore
- name: Build
run: dotnet build --no-restore -c Release
- name: Test
run: dotnet test --no-build -c Release --logger "trx;LogFileName=results.trx" --results-directory ./TestResults
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: ./TestResults/*.trx
fail_on: test failures
action_fail: false
publish:
name: Pack & Publish
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.x
9.x
10.0.x
- name: Pack
run: dotnet pack src/PollyOpenAI/PollyOpenAI.csproj -c Release --output nupkgs
- name: Upload package artifact
uses: actions/upload-artifact@v4
with:
name: nupkg
path: nupkgs/
- name: Publish to NuGet.org
run: dotnet nuget push nupkgs/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate