Skip to content

Commit a4bbb5a

Browse files
Build GH Action Build matching Azure DevOps Pipeline (#706)
* Try to match Azure DevOps build pipeline * Move env to where it belongs * Fix refs * Fix run_number * Fix naming * Try building with msbuild instead * Expressly reference tests assembly * Remove hardcoded 'Release' (should be in matrix...) * Specify configuration for pack * Add code conv tool to collected outputs * Fix copy/paste error on extension
1 parent 465bc2d commit a4bbb5a

1 file changed

Lines changed: 57 additions & 0 deletions

File tree

.github/workflows/dotnet.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Build CodeConverter
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
runs-on: windows-latest
12+
env:
13+
BuildVersion: '8.2.2'
14+
BuildPlatform: Any CPU
15+
BuildTarget: Release
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Update project version
19+
uses: roryprimrose/set-vs-sdk-project-version@v1
20+
with:
21+
projectFilter: '**/CodeConverter.csproj'
22+
version: ${{ env.BuildVersion }}.${{ github.run_number }}
23+
assemblyVersion: ${{ env.BuildVersion }}.${{ github.run_number }}
24+
fileVersion: ${{ env.BuildVersion }}.${{ github.run_number }}
25+
- name: Setup .NET
26+
uses: actions/setup-dotnet@v1
27+
with:
28+
dotnet-version: 3.1.x
29+
- name: Add msbuild to PATH
30+
uses: microsoft/setup-msbuild@v1.0.2
31+
with:
32+
vs-version: '[16.6,16.9)'
33+
- name: Restore the application
34+
run: msbuild CodeConverter.sln /t:Restore /p:Configuration=$env:BuildTarget /p:Platform=$env:BuildPlatform
35+
- name: Build
36+
run: msbuild CodeConverter.sln /p:Configuration=$env:BuildTarget /p:Platform=$env:BuildPlatform
37+
- name: Execute unit tests
38+
run: dotnet test $env:Tests1
39+
env:
40+
Tests1: Tests\bin\${{ env.BuildTarget }}\ICSharpCode.CodeConverter.Tests.dll
41+
- name: Pack
42+
run: dotnet pack CodeConverter/CodeConverter.csproj -c $env:BuildTarget
43+
- name: Upload NuGet package
44+
uses: actions/upload-artifact@v2
45+
with:
46+
name: ICSharpCode.CodeConverter.${{ env.BuildVersion }}.nupkg
47+
path: CodeConverter\bin\${{ env.BuildTarget }}\ICSharpCode.CodeConverter.*.nupkg
48+
- name: Upload VSIX
49+
uses: actions/upload-artifact@v2
50+
with:
51+
name: ICSharpCode.CodeConverter.VsExtension.${{ env.BuildVersion }}.vsix
52+
path: Vsix\bin\${{ env.BuildTarget }}\ICSharpCode.CodeConverter.VsExtension.vsix
53+
- name: Upload code conv tool
54+
uses: actions/upload-artifact@v2
55+
with:
56+
name: ICSharpCode.CodeConverter.CodeConv.${{ env.BuildVersion }}.nupkg
57+
path: CommandLine\CodeConv\bin\${{ env.BuildTarget }}\ICSharpCode.CodeConverter.CodeConv.*.nupkg

0 commit comments

Comments
 (0)