-
Notifications
You must be signed in to change notification settings - Fork 235
129 lines (109 loc) · 4.3 KB
/
dotnet.yml
File metadata and controls
129 lines (109 loc) · 4.3 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Build CodeConverter
on:
push:
branches: [ master, main ]
pull_request:
branches: [ master, main ]
workflow_dispatch:
env:
BuildVersion: '10.0.0'
jobs:
build:
runs-on: windows-2022
env:
BuildPlatform: Any CPU
BuildTarget: Release
steps:
- uses: actions/checkout@v4
- name: Update project version
uses: roryprimrose/set-vs-sdk-project-version@v1.0.6
with:
projectFilter: 'Directory.Build.props'
version: ${{ env.BuildVersion }}.${{ github.run_number }}
assemblyVersion: ${{ env.BuildVersion }}.${{ github.run_number }}
fileVersion: ${{ env.BuildVersion }}.${{ github.run_number }}
- name: Setup .NET for main build
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
with:
vs-version: '[17.0,)'
- name: Dotnet deterministic Build
run: dotnet build DotNetBuildable.slnf /p:Platform=$env:BuildPlatform /p:Configuration=$env:BuildTarget /p:ContinuousIntegrationBuild=true
- name: Dotnet Publish
run: dotnet publish DotNetPublishable.slnf /p:Platform=$env:BuildPlatform /p:Configuration=$env:BuildTarget
- name: MSBuild Vsix
run: msbuild Vsix\Vsix.csproj -restore /p:Configuration=$env:BuildTarget
- name: Execute unit tests
run: dotnet test $env:Tests1
env:
Tests1: Tests/bin/${{ env.BuildTarget }}/ICSharpCode.CodeConverter.Tests.dll
- name: Run vitest
working-directory: Web
run: npm test -- --run
- name: Upload NuGet package
uses: actions/upload-artifact@v4
with:
name: ICSharpCode.CodeConverter.${{ env.BuildVersion }}.nupkg
path: CodeConverter/bin/${{ env.BuildTarget }}/ICSharpCode.CodeConverter.*.nupkg
- name: Upload VSIX
uses: actions/upload-artifact@v4
with:
name: ICSharpCode.CodeConverter.VsExtension.${{ env.BuildVersion }}.vsix
path: Vsix/bin/${{ env.BuildTarget }}/ICSharpCode.CodeConverter.VsExtension.vsix
- name: Upload Tool
uses: actions/upload-artifact@v4
with:
name: ICSharpCode.CodeConverter.CodeConv.${{ env.BuildVersion }}.nupkg
path: CodeConv/bin/${{ env.BuildTarget }}/ICSharpCode.CodeConverter.CodeConv.*.nupkg
- name: Upload Web
uses: actions/upload-artifact@v4
with:
name: ICSharpCode.CodeConverter.Web.${{ env.BuildVersion }}.zip
path: web/dist/
- name: Upload Function
uses: actions/upload-artifact@v4
with:
name: ICSharpCode.CodeConverter.Func.${{ env.BuildVersion }}.zip
path: Func/bin/${{ env.BuildTarget }}/publish/
deploy:
if: ${{ github.event_name == 'workflow_dispatch' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main') }}
concurrency: ci-${{ github.ref }}
needs: [build] # The second job must depend on the first one to complete before running and uses ubuntu-latest instead of windows.
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Download Artifacts 🔻 # The built project is downloaded into the 'site' folder.
uses: actions/download-artifact@v4
with:
name: ICSharpCode.CodeConverter.Web.${{ env.BuildVersion }}.zip
path: site
- name: Download all release artifacts
uses: actions/download-artifact@v4
with:
path: release-artifacts
- name: Extract latest changelog section
id: changelog
shell: pwsh
run: |
./Get-LatestChangelog.ps1 -Path CHANGELOG.md | Tee-Object -FilePath release-notes.md
"notes<<EOF" >> $env:GITHUB_OUTPUT
Get-Content release-notes.md >> $env:GITHUB_OUTPUT
"EOF" >> $env:GITHUB_OUTPUT
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: 'autoupdated/gh-pages'
folder: 'site/wwwroot'
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ env.BuildVersion }}.${{ github.run_number }}
name: v${{ env.BuildVersion }}.${{ github.run_number }}
body: ${{ steps.changelog.outputs.notes }}
files: release-artifacts/**