Install SDK and .NET #14
Workflow file for this run
This file contains 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: CI | |
on: | |
push: | |
branches: '**' | |
tags: 'v*' | |
pull_request: | |
branches: '**' | |
env: | |
BUILD_VERSION: 23.6.0.${{ github.run_number }} | |
jobs: | |
build-and-test: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Chocolatey | |
uses: chocolatey/setup-chocolatey@v1 | |
- name: Install Windows SDK | |
run: | | |
choco install windows-sdk-10-10.0.15063.0 -y | |
refreshenv | |
- name: Install .NET Framework targeting pack | |
run: | | |
choco install netfx-4.6.1-devpack -y | |
refreshenv | |
- name: Set up MSBuild | |
uses: microsoft/setup-msbuild@v1 | |
- name: Restore NuGet packages | |
run: nuget restore | |
- name: Patch C++ Version Info | |
shell: pwsh | |
run: | | |
$content = Get-Content Profiler/version.h | |
$newContent = $content -replace '1\.0\.0\.0', "${env:BUILD_VERSION}" | |
$newContent = $newContent -replace '1,0,0,0', "${env:BUILD_VERSION.Replace('.', ',').Split('-')[0]}" | |
$newContent | Set-Content Profiler/version.h | |
- name: Build | |
run: msbuild Cqse.Teamscale.Profiler.Dotnet.sln /p:Platform=Win32 | |
- name: Test | |
shell: pwsh | |
run: | | |
vstest.console /parallel | |
Profiler_Cpp_Test/bin/Release/x86/Profiler_Cpp_Test.dll | |
Profiler_Test/bin/Release/Profiler_Test.dll | |
UploadDaemon_Test/bin/Release/UploadDaemon_Test.dll | |
- name: Install markdown-pdf | |
run: npm install markdown-pdf | |
- name: Convert documentation | |
run: node_modules/.bin/markdown-pdf -c documentation -s documentation/pdf.css -f A4 documentation/userguide.md | |
- name: Create release zip | |
run: | | |
mkdir teamscale_dotnet_profiler\UploadDaemon | |
mkdir teamscale_dotnet_profiler\Documentation | |
mkdir teamscale_dotnet_profiler\Licenses | |
mkdir teamscale_dotnet_profiler\Tools | |
robocopy .\Profiler\bin\Release teamscale_dotnet_profiler *.dll *.pdb || exit 0 | |
robocopy .\Profiler teamscale_dotnet_profiler Profiler.example.yml || exit 0 | |
robocopy .\Profiler\bin\Release\UploadDaemon teamscale_dotnet_profiler\UploadDaemon *.* /xf *.pdb || exit 0 | |
mkdir teamscale_dotnet_profiler\UploadDaemon\service | |
robocopy .\UploadDaemon\service teamscale_dotnet_profiler\UploadDaemon\service *.* || exit 0 | |
robocopy .\Profiler\bin\Release\DumpPdb teamscale_dotnet_profiler\Tools *.* /xf *.pdb || exit 0 | |
robocopy . teamscale_dotnet_profiler LICENSE || exit 0 | |
robocopy .\Profiler\lib teamscale_dotnet_profiler\Licenses LICENSE /s || exit 0 | |
robocopy .\documentation teamscale_dotnet_profiler\Documentation userguide.pdf || exit 0 | |
7z a teamscale-profiler-dotnet.zip .\teamscale_dotnet_profiler | |
- name: Upload Release Assets | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
asset_name: teamscale-profiler-dotnet_v${{env.BUILD_VERSION}}.zip | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.ref }} | |
file: 'teamscale-profiler-dotnet.zip' | |
overwrite: true |