Merge pull request #1214 from icsharpcode/christophwille/net10func #885
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build CodeConverter | |
| on: | |
| push: | |
| branches: [ master, main ] | |
| pull_request: | |
| branches: [ master, main ] | |
| 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/ | |