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: |
|
||||
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 }}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user