Skip to content

Commit 0f5f534

Browse files
authored
Merge branch 'master' into upstream-pr
2 parents 37395c3 + 22c751a commit 0f5f534

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Build and Deploy
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
env:
10+
DOTNET_VERSION: '8.0.x'
11+
CONFIGURATION: Release
12+
13+
jobs:
14+
build:
15+
runs-on: windows-latest
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0 # Required for Source Link
22+
23+
- name: Setup .NET
24+
uses: actions/setup-dotnet@v4
25+
with:
26+
dotnet-version: ${{ env.DOTNET_VERSION }}
27+
28+
- name: Restore dependencies
29+
run: dotnet restore
30+
31+
- name: Build
32+
run: dotnet build --configuration ${{ env.CONFIGURATION }} --no-restore
33+
34+
- name: Test
35+
run: dotnet test --configuration ${{ env.CONFIGURATION }} --no-build --verbosity normal --filter "TestCategory=AppVeyor"
36+
37+
- name: Pack NuGet packages
38+
run: dotnet pack --configuration ${{ env.CONFIGURATION }} --no-build --output ./artifacts
39+
40+
- name: Upload artifacts
41+
uses: actions/upload-artifact@v4
42+
with:
43+
name: nuget-packages
44+
path: ./artifacts/*.nupkg
45+
46+
- name: Upload symbol packages
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: symbol-packages
50+
path: ./artifacts/*.snupkg
51+
52+
- name: Publish to NuGet
53+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
54+
run: dotnet nuget push ./artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
55+
env:
56+
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}

0 commit comments

Comments
 (0)