2021-05-03 14:04:58 +02:00
|
|
|
$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;
|
2021-05-03 15:43:50 +02:00
|
|
|
& $env:PYTHON\python.exe $env:ROOT_FOLDER\scripts\deploy.py pack .\package\valentina\ "$env:BUILD_FOLDER\package\valentina-win-$env:PLATFORM-$env:QT_VERSION-$env:APPVEYOR_REPO_BRANCH-$env:APPVEYOR_REPO_COMMIT.tar.xz";
|
2021-05-03 14:14:00 +02:00
|
|
|
if ($LastExitCode -ne 0) {
|
|
|
|
Write-Error -Message "[CI] Error creating an archive." -Category InvalidResult;
|
|
|
|
exit 1;
|
|
|
|
} else {
|
|
|
|
Write-Host "[CI] Done." -ForegroundColor Green;
|
|
|
|
}
|
2021-05-03 14:04:58 +02:00
|
|
|
|
|
|
|
Write-Host "[CI] Uploading." -ForegroundColor Green;
|
2021-05-03 14:46:34 +02:00
|
|
|
& $env:PYTHON\python.exe $env:ROOT_FOLDER\scripts\deploy.py upload $env:ACCESS_TOKEN "$env:BUILD_FOLDER\package\valentina-win-$env:PLATFORM-$env:QT_VERSION-$env:APPVEYOR_REPO_BRANCH-$env:APPVEYOR_REPO_COMMIT.zip" "/0.7.x/Windows/valentina-win-$env:PLATFORM-$env:QT_VERSION-$env:APPVEYOR_REPO_BRANCH-$env:APPVEYOR_REPO_COMMIT.zip";
|
2021-05-03 14:14:00 +02:00
|
|
|
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;
|
|
|
|
}
|
2021-05-03 14:04:58 +02:00
|
|
|
Exit 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
Write-Host "[CI] No deployment needed." -ForegroundColor Green;
|
|
|
|
Exit 0;
|
|
|
|
}
|