Skip to content

Instantly share code, notes, and snippets.

@kzu
Created September 23, 2020 19:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kzu/08462bd0e4091037307b26bf144909ed to your computer and use it in GitHub Desktop.
Save kzu/08462bd0e4091037307b26bf144909ed to your computer and use it in GitHub Desktop.
Visual Studio Preview in CI
pool:
vmImage: 'windows-2019'
steps:
- checkout: self
- task: UseDotNet@2
inputs:
packageType: sdk
version: 3.1.x
performMultiLevelLookup: true
- script: dotnet tool update -g dotnet-vs
displayName: dotnet tool update -g dotnet-vs
- pwsh: echo "##vso[task.setvariable variable=MSB]$(vs where preview --prop=InstallationPath)"
- script: vs install preview --quiet +Microsoft.VisualStudio.Component.ManagedDesktop.Core +Microsoft.NetCore.Component.DevelopmentTools
displayName: vs install preview
condition: eq(variables['MSB'], '')
- pwsh: echo "##vso[task.prependpath]$(vs where preview --prop=InstallationPath)\MSBuild\Current\Bin"
displayName: prepend MSBuild to %PATH%
- script: msbuild -r
displayName: msbuild -r
- script: msbuild -t:test
displayName: msbuild -t:test
name: build
on: push
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
- run: dotnet tool update -g dotnet-vs
- run: echo "::set-env name=MSB::$(vs where preview --prop=InstallationPath)"
- run: vs install preview --quiet +Microsoft.VisualStudio.Component.ManagedDesktop.Core +Microsoft.NetCore.Component.DevelopmentTools
if: env.MSB == ''
- run: echo "::add-path::$(vs where preview --prop=InstallationPath)\MSBuild\Current\Bin"
- run: msbuild -r
- run: msbuild -t:test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment