mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-06-28 02:52:16 +08:00
✨ Feature: support auto update now
This commit is contained in:
@@ -11,7 +11,13 @@ const darwin = [{
|
||||
ext: '.dmg',
|
||||
arch: '-x64',
|
||||
'version-file': 'latest-mac.yml'
|
||||
}]
|
||||
}, {
|
||||
appNameWithPrefix: 'PicList-',
|
||||
ext: '.dmg',
|
||||
arch: '-universal',
|
||||
'version-file': 'latest-mac.yml'
|
||||
}
|
||||
]
|
||||
|
||||
const linux = [{
|
||||
appNameWithPrefix: 'PicList-',
|
||||
|
||||
@@ -2,12 +2,13 @@ const pkg = require('../package.json')
|
||||
const version = pkg.version
|
||||
// TODO: use the same name format
|
||||
const generateURL = (platform, ext, prefix = 'PicList-') => {
|
||||
return `https://release.piclist.cn/${version}/${prefix}${version}${platform}${ext}`
|
||||
return `https://release.piclist.cn/latest/${prefix}${version}${platform}${ext}`
|
||||
}
|
||||
|
||||
const platformExtList = [
|
||||
['-arm64', '.dmg', 'PicList-'],
|
||||
['-x64', '.dmg', 'PicList-'],
|
||||
['-universal', '.dmg', 'PicList-'],
|
||||
['', '.AppImage', 'PicList-'],
|
||||
['-ia32', '.exe', 'PicList-Setup-'],
|
||||
['-x64', '.exe', 'PicList-Setup-'],
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user