Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix release publish step #11131

Merged
merged 1 commit into from
Mar 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 26 additions & 23 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -1088,29 +1088,32 @@ async function deployCesiumRelease(bucketName, s3Client, errors) {
`Cesium version ${release.tag} up to date. Skipping release deployment.`
);
} catch (error) {
// The current version is not uploaded
if (error.code === "NotFound") {
console.log("Updating cesium version...");
const data = await download(release.url);
// upload and unzip contents
const key = posix.join(releaseDir, release.tag, "cesium.zip");
await uploadObject(bucketName, s3Client, key, data, quiet);
const files = await decompress(data);
const limit = pLimit(5);
return Promise.all(
files.map((file) => {
return limit(() => {
if (file.path.startsWith("Apps")) {
// skip uploading apps and sandcastle
return;
}

// Upload to release directory
const key = posix.join(releaseDir, release.tag, file.path);
return uploadObject(bucketName, s3Client, key, file.data, quiet);
});
})
);
if (error.$metadata) {
const { httpStatusCode } = error.$metadata;
// The current version is not uploaded
if (httpStatusCode === 404) {
console.log("Updating cesium version...");
const data = await download(release.url);
// upload and unzip contents
const key = posix.join(releaseDir, release.tag, "cesium.zip");
await uploadObject(bucketName, s3Client, key, data, quiet);
const files = await decompress(data);
const limit = pLimit(5);
return Promise.all(
files.map((file) => {
return limit(async () => {
if (file.path.startsWith("Apps")) {
// skip uploading apps and sandcastle
return;
}

// Upload to release directory
const key = posix.join(releaseDir, release.tag, file.path);
return uploadObject(bucketName, s3Client, key, file.data, quiet);
});
})
);
}
}

// else, unexpected error
Expand Down