|
|
|
@ -168,6 +168,30 @@ async function main() { |
|
|
|
|
|
|
|
|
|
let files = await readReleaseFilesFromLocalDirectory() |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
if (fs.existsSync(path.join(__dirname, '../../../release', 'latest-mac-arm64.yml')) && fs.existsSync(path.join(__dirname, '../../../release', 'latest-mac.yml'))) { |
|
|
|
|
// combine the two files
|
|
|
|
|
const macArm64 = fs.readFileSync(path.join(__dirname, '../../../release', 'latest-mac-arm64.yml'), 'utf8') |
|
|
|
|
const mac = fs.readFileSync(path.join(__dirname, '../../../release', 'latest-mac.yml'), 'utf8') |
|
|
|
|
const parsedMacArm64 = YAML.parse(macArm64) |
|
|
|
|
const parsedMac = YAML.parse(mac) |
|
|
|
|
const combined = { |
|
|
|
|
...parsedMac, |
|
|
|
|
files: { |
|
|
|
|
...parsedMac.files, |
|
|
|
|
...parsedMacArm64.files |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
console.log(combined) |
|
|
|
|
const newYml = YAML.stringify(combined) |
|
|
|
|
fs.writeFileSync(path.join(__dirname, '../../../release', 'latest-mac.yml'), newYml) |
|
|
|
|
// remove the arm64 file
|
|
|
|
|
fs.unlinkSync(path.join(__dirname, '../../../release', 'latest-mac-arm64.yml')) |
|
|
|
|
} |
|
|
|
|
} catch (e) { |
|
|
|
|
console.log(e) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
files = files.filter((file) => file.endsWith('.zip') || file.endsWith('.dmg') || file.endsWith('.exe') || file.endsWith('.AppImage') || file.endsWith('.snap') || file.endsWith('.deb') || file.startsWith('latest')) |
|
|
|
|
console.log(`Found ${files.length} files to upload`) |
|
|
|
|
console.log(files) |
|
|
|
|