mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-05-06 20:42:57 +08:00
📦 Chore(custom): update scripts
This commit is contained in:
3
.github/workflows/buid_arch.yml
vendored
3
.github/workflows/buid_arch.yml
vendored
@@ -314,10 +314,9 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
if [ "${{ github.event.inputs.publish_enabled }}" == "false" ]; then
|
if [ "${{ github.event.inputs.publish_enabled }}" == "false" ]; then
|
||||||
echo "Publishing is disabled. Skipping upload to S3."
|
echo "Publishing is disabled. Skipping upload to S3."
|
||||||
node scripts/upload-to-s3.js ./artifacts ./dist_electron/combined
|
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
node scripts/upload-to-s3.js ./artifacts ./dist_electron/combined false
|
node scripts/upload-to-s3.js ./artifacts ./dist_electron/combined
|
||||||
env:
|
env:
|
||||||
R2_SECRET_ID: ${{ secrets.R2_SECRET_ID }}
|
R2_SECRET_ID: ${{ secrets.R2_SECRET_ID }}
|
||||||
R2_SECRET_KEY: ${{ secrets.R2_SECRET_KEY }}
|
R2_SECRET_KEY: ${{ secrets.R2_SECRET_KEY }}
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ const ymlFileList = ['latest-mac.yml', 'latest.yml', 'latest-linux.yml', 'latest
|
|||||||
const args = process.argv.slice(2)
|
const args = process.argv.slice(2)
|
||||||
const exePath = args[0] || './artifacts'
|
const exePath = args[0] || './artifacts'
|
||||||
const ymlPath = args[1] || './dist_electron/combined'
|
const ymlPath = args[1] || './dist_electron/combined'
|
||||||
const idDev = args[2] ?? true
|
|
||||||
|
|
||||||
const S3Options = {
|
const S3Options = {
|
||||||
credentials: {
|
credentials: {
|
||||||
@@ -52,18 +51,7 @@ const uploadFile = async filePath => {
|
|||||||
uploadDistToS3.on('httpUploadProgress', progress => {
|
uploadDistToS3.on('httpUploadProgress', progress => {
|
||||||
console.log(`[INFO]: ${path.basename(filePath)} - ${progress.loaded}/${progress.total}`)
|
console.log(`[INFO]: ${path.basename(filePath)} - ${progress.loaded}/${progress.total}`)
|
||||||
})
|
})
|
||||||
if (idDev) {
|
await uploadDistToS3.done()
|
||||||
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 {
|
} else {
|
||||||
console.warn('[Warn] File not found:', filePath)
|
console.warn('[Warn] File not found:', filePath)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user