Ensure cirrus scripts don't upload rolling release on pr or commit builds

This commit is contained in:
confused-Techie 2023-08-27 20:42:50 -07:00
parent 96f9f91c0a
commit e18e8628d0
2 changed files with 17 additions and 2 deletions

View File

@ -101,7 +101,7 @@ arm_linux_task:
rolling_upload_script:
- cd ./script/rolling-release-scripts
- npm install
- node ./rolling-release-binary-upload.js
- node ./rolling-release-binary-upload.js cirrus
always:
videos_artifacts:
path: ./tests/videos/**
@ -149,7 +149,7 @@ silicon_mac_task:
rolling_upload_script:
- cd ./script/rolling-release-scripts
- npm install
- node ./rolling-release-binary-upload.js
- node ./rolling-release-binary-upload.js cirrus
always:
videos_artifacts:
path: ./tests/videos/**

View File

@ -16,6 +16,21 @@ if (verSegments[verSegments.length - 1].length > 4) {
process.exit(0);
}
// Again since cirrus ALWAYS triggers this script, without being able to skip for
// non PR builds, Cirrus provides cli args to indicate that it is being run via cirrus,
// so we can exit depending on the presence of certain env vars
let cirrusFlag = process.argv.slice(2)[0];
if (cirrusFlag === "cirrus") {
if (typeof process.env.CIRRUS_CHANGE_MESSAGE === "string") {
// This build is the result of a PR or commit, not a cron job rolling release,
// lets exit
console.log("Due to the presence of `CIRRUS_CHANGE_MESSAGE` it seems this is a PR created build...");
console.log("Exiting without uploading binaries...");
process.exit(0);
}
}
(async () => {
if (!fs.existsSync("../../binaries")) {