Feature: support auto update now

This commit is contained in:
萌萌哒赫萝
2023-04-05 22:55:35 +08:00
parent ca950dbd44
commit e39cac9f3b
14 changed files with 130 additions and 7 deletions
+6 -1
View File
@@ -10,7 +10,7 @@ const path = require('path')
const BUCKET = 'piclist-dl'
const VERSION = pkg.version
const FILE_PATH = `${VERSION}/`
const FILE_PATH = `latest/`
const ACCOUNT_ID = process.env.R2_ACCOUNT_ID
const SECRET_ID = process.env.R2_SECRET_ID
const SECRET_KEY = process.env.R2_SECRET_KEY
@@ -78,6 +78,11 @@ const uploadFile = async () => {
Key: `${versionFileName}`,
Body: versionFileBuffer
}).promise()
await s3.upload({
Bucket: BUCKET,
Key: `${FILE_PATH}${versionFileName}`,
Body: versionFileBuffer
}).promise()
versionFileHasUploaded = true
}
}