diff --git a/Setup.ps1 b/Setup.ps1 new file mode 100644 index 00000000..8bc3fbed --- /dev/null +++ b/Setup.ps1 @@ -0,0 +1,11 @@ +$ErrorActionPreference = "Stop" + +$RequiredDotnetVersion = $(cat ./global.json | convertfrom-json).sdk.version + +New-Item -ItemType Directory -Force "./build/" | Out-Null + +Invoke-WebRequest "https://dot.net/v1/dotnet-install.ps1" -OutFile "./build/installcli.ps1" +& ./build/installcli.ps1 -InstallDir "$pwd/.dotnetcli" -NoPath -Version $RequiredDotnetVersion +if ($LASTEXITCODE) { exit 1 } + +$env:Path = "$pwd/.dotnetcli;$env:Path" diff --git a/appveyor.yml b/appveyor.yml index 5f3547de..133f5f51 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -19,9 +19,12 @@ for: only: - image: Visual Studio 2019 - build_script: - - ps: ./Build.ps1 -shortver "$($env:APPVEYOR_BUILD_VERSION)" + install: + - ps: ./Setup.ps1 + build_script: + - ps: ./Build.ps1 -shortver "$($env:APPVEYOR_BUILD_VERSION)" + deploy: - provider: GitHub auth_token: diff --git a/global.json b/global.json index 70a59a3e..c120c811 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "3.1.201" + "version": "3.1.301" } } \ No newline at end of file diff --git a/seqcli.sln b/seqcli.sln index 60e5b809..5fce66ea 100644 --- a/seqcli.sln +++ b/seqcli.sln @@ -17,6 +17,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sln", "sln", "{2EA56595-519 setup.sh = setup.sh Build.Docker.ps1 = Build.Docker.ps1 docker-publish.ps1 = docker-publish.ps1 + Setup.ps1 = Setup.ps1 EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{3587B633-0C03-4235-8903-6226900328F1}" diff --git a/src/SeqCli/SeqCli.csproj b/src/SeqCli/SeqCli.csproj index 57067b4b..8626d317 100644 --- a/src/SeqCli/SeqCli.csproj +++ b/src/SeqCli/SeqCli.csproj @@ -19,7 +19,7 @@ - +