feat(release): change binaries filenames

This commit is contained in:
George Lima 2019-04-15 22:12:29 -03:00
parent 6e53da76d9
commit d967ffc4e8
2 changed files with 18 additions and 2 deletions

View File

@ -178,7 +178,6 @@
"category": "public.app-category.productivity", "category": "public.app-category.productivity",
"type": "distribution", "type": "distribution",
"target": [ "target": [
"pkg",
"dmg" "dmg"
], ],
"icon": "./build/icons/mac/icon.icns" "icon": "./build/icons/mac/icon.icns"

View File

@ -33,6 +33,23 @@ const signBinaries = binaries => new Promise((resolve, reject) => {
}); });
}); });
const getFileName = (name) => {
const extension = name.substr(name.length - 3);
switch (extension) {
case 'dmg':
return `Zepio-macOS-v${VERSION}.dmg`;
case 'deb':
return `zepio-linux-v${VERSION}.deb`;
case 'exe':
return `Zepio-Windows-v${VERSION}.exe`;
case 'zip':
return `signatures-v${VERSION}.zip`;
default:
return 'Zepio';
}
};
(async () => { (async () => {
console.log(`Creating release v${VERSION}`); console.log(`Creating release v${VERSION}`);
@ -74,7 +91,7 @@ const signBinaries = binaries => new Promise((resolve, reject) => {
'content-type': mime.lookup(fPath), 'content-type': mime.lookup(fPath),
}, },
url: createReleaseResponse.data.upload_url, url: createReleaseResponse.data.upload_url,
name, name: getFileName(name),
file: fs.createReadStream(fPath), file: fs.createReadStream(fPath),
}); });
}), }),