Skip to content

Commit 4e5639e

Browse files
Basic CI structure with GitHub Actions (#265)
* Basic CI structure * NETSDK1100: Windows is required to build Windows desktop applications. * Switch to nuget restore * Cleanup * Fix NuGet restore step
1 parent 106b31e commit 4e5639e

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

.github/workflows/dotnet.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Build AvalonEdit
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: windows-latest
13+
strategy:
14+
matrix:
15+
Configuration: [ Debug, Release ]
16+
env:
17+
Solution: '**/ICSharpCode.AvalonEdit.sln'
18+
BuildPlatform: 'Any CPU'
19+
BuildVersion: '6.1.0'
20+
NupkgVersion: '6.1.0-preview2'
21+
steps:
22+
- uses: actions/checkout@v2
23+
- name: Update project version
24+
uses: roryprimrose/set-vs-sdk-project-version@v1
25+
with:
26+
projectFilter: '**/ICSharpCode.AvalonEdit.csproj'
27+
version: ${{ env.NupkgVersion }}
28+
assemblyVersion: ${{ env.BuildVersion }}.${{ github.run_number }}
29+
fileVersion: ${{ env.BuildVersion }}.${{ github.run_number }}
30+
- name: Setup .NET
31+
uses: actions/setup-dotnet@v1
32+
with:
33+
dotnet-version: 5.0.x
34+
- name: Setup NuGet.exe
35+
uses: nuget/setup-nuget@v1
36+
- run: nuget restore ICSharpCode.AvalonEdit.sln
37+
- name: Build
38+
run: dotnet build ICSharpCode.AvalonEdit.sln --no-restore -c ${{ matrix.configuration }}
39+
- name: Test
40+
run: dotnet test ICSharpCode.AvalonEdit.sln --no-build --verbosity normal -c ${{ matrix.configuration }}
41+
- name: Style - tab check
42+
run: python BuildTools\tidy.py
43+
- name: Pack
44+
run: dotnet pack ICSharpCode.AvalonEdit/ICSharpCode.AvalonEdit.csproj -c ${{ matrix.configuration }}
45+
- name: Upload NuGet
46+
if: matrix.configuration == 'release'
47+
uses: actions/upload-artifact@v2
48+
with:
49+
name: AvalonEdit NuGet Package (${{ matrix.configuration }})
50+
path: ICSharpCode.AvalonEdit/bin/Release/AvalonEdit*.nupkg
51+
if-no-files-found: error
52+
- name: Publish NuGet
53+
if: github.ref == 'refs/heads/master' && matrix.configuration == 'release'
54+
run: |
55+
dotnet nuget push "ICSharpCode.AvalonEdit/bin/Release/AvalonEdit*.nupkg" --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/${{ github.repository_owner }}

0 commit comments

Comments
 (0)