latest.yml fix
This commit is contained in:
@@ -71,6 +71,23 @@ const uploadFile = async (filePath, platform, version) => {
|
||||
)
|
||||
}
|
||||
|
||||
const uploadFileToRoot = async (filePath, platform) => {
|
||||
const fileStream = fs.createReadStream(filePath)
|
||||
const fileName = path.basename(filePath)
|
||||
const key = `${platform}/${fileName}`
|
||||
|
||||
console.log(`Uploading ${fileName} → ${key} (latest)`)
|
||||
|
||||
await client.send(
|
||||
new PutObjectCommand({
|
||||
Bucket: BUCKET,
|
||||
Key: key,
|
||||
Body: fileStream,
|
||||
ContentType: getContentType(fileName),
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
||||
const main = async () => {
|
||||
const platform = process.argv[2]
|
||||
const version = process.argv[3]
|
||||
@@ -128,7 +145,13 @@ const main = async () => {
|
||||
|
||||
for (const file of uploadTargets) {
|
||||
const fullPath = path.join(DIST_DIR, file)
|
||||
await uploadFile(fullPath, platform, version)
|
||||
|
||||
// Keep latest.yml up to date for platform
|
||||
if (file.startsWith('latest') && file.endsWith('.yml')) {
|
||||
await uploadFileToRoot(fullPath, platform)
|
||||
} else {
|
||||
await uploadFile(fullPath, platform, version)
|
||||
}
|
||||
}
|
||||
|
||||
console.log('Upload complete.')
|
||||
|
||||
Reference in New Issue
Block a user