From 542008a4ba750a3b412690385a1d79e487be2eec Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 3 May 2021 15:14:00 +0300 Subject: [PATCH] Improvements for the script. --- scripts/appveyor-deploy.ps1 | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/scripts/appveyor-deploy.ps1 b/scripts/appveyor-deploy.ps1 index 474f62b43..f882f5475 100644 --- a/scripts/appveyor-deploy.ps1 +++ b/scripts/appveyor-deploy.ps1 @@ -3,12 +3,22 @@ $env:BUILD_FOLDER = "C:\projects\valentina\build"; if($env:DEPLOY -eq "true") { Write-Host "[CI] Starting packing." -ForegroundColor Green; - $env:PYTHON\python.exe $env:ROOT_FOLDER\scripts\deploy.py pack .\package\valentina\ "$env:BUILD_FOLDER\package\valentina-win-$(PLATFORM)-$(QT_VERSION)-$(APPVEYOR_REPO_BRANCH)-$(APPVEYOR_REPO_COMMIT).zip"; - Write-Host "[CI] Done." -ForegroundColor Green; + & $env:PYTHON\python.exe $env:ROOT_FOLDER\scripts\deploy.py pack .\package\valentina\ "$env:BUILD_FOLDER\package\valentina-win-$(PLATFORM)-$(QT_VERSION)-$(APPVEYOR_REPO_BRANCH)-$(APPVEYOR_REPO_COMMIT).zip"; + if ($LastExitCode -ne 0) { + Write-Error -Message "[CI] Error creating an archive." -Category InvalidResult; + exit 1; + } else { + Write-Host "[CI] Done." -ForegroundColor Green; + } Write-Host "[CI] Uploading." -ForegroundColor Green; - $env:PYTHON\python.exe $env:ROOT_FOLDER\scripts\deploy.py upload $env:ACCESS_TOKEN "$env:BUILD_FOLDER\package\valentina-win-$(PLATFORM)-$(QT_VERSION)-$(APPVEYOR_REPO_BRANCH)-$(APPVEYOR_REPO_COMMIT).zip" "/0.7.x/Windows/valentina-win-$(PLATFORM)-$(QT_VERSION)-$(APPVEYOR_REPO_BRANCH)-$(APPVEYOR_REPO_COMMIT).zip"; - Write-Host "[CI] Uploading has been finished." -ForegroundColor Green; + & $env:PYTHON\python.exe $env:ROOT_FOLDER\scripts\deploy.py upload $env:ACCESS_TOKEN "$env:BUILD_FOLDER\package\valentina-win-$(PLATFORM)-$(QT_VERSION)-$(APPVEYOR_REPO_BRANCH)-$(APPVEYOR_REPO_COMMIT).zip" "/0.7.x/Windows/valentina-win-$(PLATFORM)-$(QT_VERSION)-$(APPVEYOR_REPO_BRANCH)-$(APPVEYOR_REPO_COMMIT).zip"; + if ($LastExitCode -ne 0) { + Write-Error -Message "[CI] Error uploading an artifact." -Category InvalidResult; + exit 1; + } else { + Write-Host "[CI] Uploading has been finished." -ForegroundColor Green; + } Exit 0; } else {