Skip to content

Commit a27e296

Browse files
committed
clean up after publishing
1 parent d966ca7 commit a27e296

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

publish/publish.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,18 @@ function fileUpload(OssClient $client, string $bucket, string $object, string $f
140140
]);
141141
}
142142

143+
function fileDelete(OssClient $client, string $bucket, string $object): void
144+
{
145+
try {
146+
$client->deleteObject([
147+
'bucket' => $bucket,
148+
'key' => $object,
149+
]);
150+
} catch (Throwable) {
151+
// Ignore any error
152+
}
153+
}
154+
143155
function fileChecksum(string $filename): string
144156
{
145157
$contents = file_get_contents($filename);
@@ -239,6 +251,9 @@ function getRuntimeFromLayerName(string $layerName): string
239251

240252
step("Ensure layer is public in {$region}");
241253
layerEnsureIsPublic($fc, $variant);
254+
255+
step('Clean up the uploaded package after publishing');
256+
fileDelete($oss, $bucketName, $objectName);
242257
}
243258

244259
step('Publish is done');

0 commit comments

Comments
 (0)