version: 1.0.{build} image: Visual Studio 2017 environment: ApiKey: secure: Ey3OKb/MT5Cj0MzTOeXOHcKTG9eHz8tasxNShSmFhPE= TimeOutMins: 2 jobToWait: 'Environment: winfinite_solution=Winfinite/Winfinite.sln' matrix: - winfinite_solution: Winfinite/Winfinite.sln - winfinite_solution: UnitTests/UnitTests.sln install: - ps: | if ($env:APPVEYOR_JOB_NAME -eq $env:jobToWait) { Push-AppveyorArtifact .\Winfinite\Winfinite\bin\Debug\Winfinite.dll } if ($env:APPVEYOR_JOB_NAME -ne $env:jobToWait) { write-host "Waiting for job `"$env:jobToWait`" to complete" $headers = @{ "Authorization" = "Bearer $env:ApiKey" "Content-type" = "application/json" } [datetime]$stop = ([datetime]::Now).AddMinutes($env:TimeOutMins) [bool]$success = $false while(!$success -and ([datetime]::Now) -lt $stop) { $project = Invoke-RestMethod -Uri "https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG" -Headers $headers -Method GET $jobToWaitJson = $project.build.jobs | where {$_.name -eq $env:jobToWait} $success = $jobToWaitJson.status -eq "success" $jobToWaitId = $jobToWaitJson.jobId; if (!$success) {Start-sleep 5} } if (!$success) {throw "Job `"$env:jobToWait`" was not finished in $env:TimeOutMins minutes"} if (!$jobToWaitId) {throw "Unable t get JobId for the job `"$env:jobToWait`""} Start-FileDownload "https://ci.appveyor.com/api/projects/henryschmitt-versus/sdk-mithril/artifacts/Winfinite/Winfinite/bin/Debug/Winfinite.dll" } build_script: - cmd: msbuild %winfinite_solution% after_build: - ps: $root = Resolve-Path .\Winfinite\Winfinite\bin\Debug; [IO.Directory]::GetFiles($root.Path, '*.*', 'AllDirectories') | % { Push-AppveyorArtifact $_ -FileName $_.Substring($root.Path.Length + 1) -DeploymentName to-publish } before_build: - nuget restore %winfinite_solution% cache: - Winfinite\Winfinite\bin\Debug build: off test: off