From a4ea99078d4b4e05ca9d4fa45b09662e9d6035a0 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 3 May 2021 15:04:58 +0300 Subject: [PATCH] Try with PowerShell script. --- appveyor.yml | 7 +------ scripts/appveyor-deploy.ps1 | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 scripts/appveyor-deploy.ps1 diff --git a/appveyor.yml b/appveyor.yml index e1734a9bb..9c001e611 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -255,12 +255,7 @@ notifications: after_test: - if "%DEPLOY%" == "true" (mingw32-make install) -# scripts to run before deployment -before_deploy: - - if "%DEPLOY%" == "true" (python ..\scripts\deploy.py pack .\package\valentina\ ".\package\valentina-win-$(PLATFORM)-$(QT_VERSION)-$(APPVEYOR_REPO_BRANCH)-$(APPVEYOR_REPO_COMMIT).zip") - # to run your custom scripts instead of provider deployments deploy_script: - - >- - if "%DEPLOY%" == "true" (python ..\scripts\deploy.py upload %ACCESS_TOKEN% .\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) + - ps: ../scripts/appveyor-deploy.ps1 diff --git a/scripts/appveyor-deploy.ps1 b/scripts/appveyor-deploy.ps1 new file mode 100644 index 000000000..474f62b43 --- /dev/null +++ b/scripts/appveyor-deploy.ps1 @@ -0,0 +1,17 @@ +$env:ROOT_FOLDER = "C:\projects\valentina"; +$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; + + 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; + Exit 0; +} +else { + Write-Host "[CI] No deployment needed." -ForegroundColor Green; + Exit 0; +}