From 15292fda27dd3067b634338bbab87a0aaf41f533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Domeradzki?= Date: Mon, 29 Oct 2018 22:58:14 +0100 Subject: [PATCH] Enable custom dotnet for appveyor (#931) * Enable dotnet channel for appveyor * Second try * Third try --- appveyor.yml | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 8fc84db6c..3d1656046 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,13 +2,13 @@ version: '{build}-{branch}' pull_requests: do_not_increment_build_number: true skip_branch_with_pr: true -image: -- Visual Studio 2017 -- Visual Studio 2017 Preview +image: Visual Studio 2017 configuration: Release clone_depth: 10 environment: + DOTNET_CHANNEL: 2.1 DOTNET_CLI_TELEMETRY_OPTOUT: true + DOTNET_INSTALL_DIR: tools\dotnet DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true NET_CORE_VERSION: netcoreapp2.1 NET_FRAMEWORK_VERSION: net472 @@ -32,6 +32,11 @@ install: if ($LastExitCode -ne 0) { throw "Last command failed." } + + if ($env:DOTNET_CHANNEL) { + &([scriptblock]::Create((Invoke-WebRequest -Uri 'https://dot.net/v1/dotnet-install.ps1'))) -Channel "$env:DOTNET_CHANNEL" -InstallDir "$env:DOTNET_INSTALL_DIR" -NoPath + $env:Path = "$pwd\$env:DOTNET_INSTALL_DIR;$env:Path" + } before_build: - pwsh: >- Set-StrictMode -Version Latest @@ -41,6 +46,11 @@ before_build: $ProgressPreference = 'SilentlyContinue' + if (Test-Path -Path "$env:DOTNET_INSTALL_DIR" -PathType Container) { + $env:Path = "$pwd\$env:DOTNET_INSTALL_DIR;$env:Path" + } + + dotnet --info @@ -56,6 +66,11 @@ build_script: $ProgressPreference = 'SilentlyContinue' + if (Test-Path -Path "$env:DOTNET_INSTALL_DIR" -PathType Container) { + $env:Path = "$pwd\$env:DOTNET_INSTALL_DIR;$env:Path" + } + + Push-Location -Path ASF-ui @@ -93,6 +108,11 @@ test_script: $ProgressPreference = 'SilentlyContinue' + if (Test-Path -Path "$env:DOTNET_INSTALL_DIR" -PathType Container) { + $env:Path = "$pwd\$env:DOTNET_INSTALL_DIR;$env:Path" + } + + dotnet test ArchiSteamFarm.Tests -c "$env:CONFIGURATION" -f "$env:NET_CORE_VERSION" -o 'out\source' /nologo @@ -108,6 +128,11 @@ after_test: $ProgressPreference = 'SilentlyContinue' + if (Test-Path -Path "$env:DOTNET_INSTALL_DIR" -PathType Container) { + $env:Path = "$pwd\$env:DOTNET_INSTALL_DIR;$env:Path" + } + + $PublishBlock = { param($variant)