-
Notifications
You must be signed in to change notification settings - Fork 472
91 lines (74 loc) · 3.04 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Build AvalonEdit
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: windows-2022
strategy:
matrix:
Configuration: [ Debug, Release ]
env:
Solution: '**/ICSharpCode.AvalonEdit.sln'
BuildPlatform: 'Any CPU'
BuildVersion: '6.3.0'
steps:
- uses: actions/checkout@v3
- name: Update project version
uses: roryprimrose/set-vs-sdk-project-version@v1
with:
projectFilter: '**/ICSharpCode.AvalonEdit.csproj'
version: ${{ env.BuildVersion }}.${{ github.run_number }}
assemblyVersion: ${{ env.BuildVersion }}.${{ github.run_number }}
fileVersion: ${{ env.BuildVersion }}.${{ github.run_number }}
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Setup LTS .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Add msbuild to PATH
uses: microsoft/[email protected]
- run: msbuild ICSharpCode.AvalonEdit.sln /t:Restore /p:Configuration=${{ matrix.configuration }}
- name: Build
run: msbuild ICSharpCode.AvalonEdit.sln /p:Configuration=${{ matrix.configuration }}
- name: Setup VSTest
uses: Malcolmnixon/Setup-VSTest@v4
- name: net6.0-windows Unit Tests
run: vstest.console $env:TestAssembly
env:
TestAssembly: ICSharpCode.AvalonEdit.Tests\bin\${{ matrix.configuration }}\net6.0-windows\ICSharpCode.AvalonEdit.Tests.dll
- name: net8.0-windows Unit Tests
run: vstest.console $env:TestAssembly
env:
TestAssembly: ICSharpCode.AvalonEdit.Tests\bin\${{ matrix.configuration }}\net8.0-windows\ICSharpCode.AvalonEdit.Tests.dll
- name: net462 Unit Tests
run: vstest.console $env:TestAssembly
env:
TestAssembly: ICSharpCode.AvalonEdit.Tests\bin\${{ matrix.configuration }}\net462\ICSharpCode.AvalonEdit.Tests.dll
- name: Style - tab check
run: python BuildTools\tidy.py
- name: Pack
run: dotnet pack ICSharpCode.AvalonEdit/ICSharpCode.AvalonEdit.csproj -c ${{ matrix.configuration }}
- name: Upload NuGet
if: matrix.configuration == 'release'
uses: actions/upload-artifact@v3
with:
name: AvalonEdit NuGet Package (${{ matrix.configuration }})
path: ICSharpCode.AvalonEdit/bin/Release/AvalonEdit*.nupkg
if-no-files-found: error
- name: Upload Snupkg Artifact
if: matrix.configuration == 'release'
uses: actions/upload-artifact@v3
with:
name: AvalonEdit Snupkg (${{ matrix.configuration }})
path: ICSharpCode.AvalonEdit/bin/Release/AvalonEdit*.snupkg
if-no-files-found: error
- name: Publish NuGet
if: github.ref == 'refs/heads/master' && matrix.configuration == 'release'
run: |
dotnet nuget push "ICSharpCode.AvalonEdit\bin\Release\AvalonEdit*.nupkg" --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/${{ github.repository_owner }}