📦 Chore(custom): update scripts

This commit is contained in:
Kuingsmile
2026-01-27 17:43:36 +08:00
parent f95b855373
commit a2e919fff7
2 changed files with 2 additions and 15 deletions

View File

@@ -314,10 +314,9 @@ jobs:
run: |
if [ "${{ github.event.inputs.publish_enabled }}" == "false" ]; then
echo "Publishing is disabled. Skipping upload to S3."
node scripts/upload-to-s3.js ./artifacts ./dist_electron/combined
exit 0
fi
node scripts/upload-to-s3.js ./artifacts ./dist_electron/combined false
node scripts/upload-to-s3.js ./artifacts ./dist_electron/combined
env:
R2_SECRET_ID: ${{ secrets.R2_SECRET_ID }}
R2_SECRET_KEY: ${{ secrets.R2_SECRET_KEY }}

View File

@@ -21,7 +21,6 @@ const ymlFileList = ['latest-mac.yml', 'latest.yml', 'latest-linux.yml', 'latest
const args = process.argv.slice(2)
const exePath = args[0] || './artifacts'
const ymlPath = args[1] || './dist_electron/combined'
const idDev = args[2] ?? true
const S3Options = {
credentials: {
@@ -52,18 +51,7 @@ const uploadFile = async filePath => {
uploadDistToS3.on('httpUploadProgress', progress => {
console.log(`[INFO]: ${path.basename(filePath)} - ${progress.loaded}/${progress.total}`)
})
if (idDev) {
console.log('[DEV]: upload params:', {
Bucket: bucket,
Key: `${folder}${path.basename(filePath)}`,
Body: '<<stream>>',
ContentType: path.basename(filePath).endsWith('.yml')
? mime.getType(path.basename(filePath))
: 'application/octet-stream',
})
} else {
await uploadDistToS3.done()
}
} else {
console.warn('[Warn] File not found:', filePath)
}