Skip to content
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
15 changes: 15 additions & 0 deletions publish/publish.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,18 @@ function fileUpload(OssClient $client, string $bucket, string $object, string $f
]);
}

function fileDelete(OssClient $client, string $bucket, string $object): void
{
try {
$client->deleteObject([
'bucket' => $bucket,
'key' => $object,
]);
} catch (Throwable) {
// Ignore any error
}
}

function fileChecksum(string $filename): string
{
$contents = file_get_contents($filename);
Expand Down Expand Up @@ -239,6 +251,9 @@ function getRuntimeFromLayerName(string $layerName): string

step("Ensure layer is public in {$region}");
layerEnsureIsPublic($fc, $variant);

step('Clean up the uploaded package after publishing');
fileDelete($oss, $bucketName, $objectName);
}

step('Publish is done');