Sign manually without using Squirrel

This commit is contained in:
Damien Guard
2017-07-19 11:48:31 -07:00
parent d15e65a2c0
commit db2800dac9
3 changed files with 35 additions and 76 deletions

View File

@@ -10,6 +10,7 @@ require('./bootstrap')
require('coffee-script/register')
require('colors')
const path = require('path')
const yargs = require('yargs')
const argv = yargs
.usage('Usage: $0 [options]')
@@ -75,34 +76,40 @@ binariesPromise
.then(packageApplication)
.then(packagedAppPath => generateStartupSnapshot(packagedAppPath).then(() => packagedAppPath))
.then(packagedAppPath => {
if (process.platform === 'darwin') {
if (argv.codeSign) {
codeSignOnMac(packagedAppPath)
} else {
console.log('Skipping code-signing. Specify the --code-sign option to perform code-signing'.gray)
}
} else if (process.platform === 'win32') {
if (argv.createWindowsInstaller) {
return createWindowsInstaller(packagedAppPath, argv.codeSign).then(() => packagedAppPath)
} else {
console.log('Skipping creating installer. Specify the --create-windows-installer option to create a Squirrel-based Windows installer.'.gray)
switch (process.platform) {
case 'darwin': {
if (argv.codeSign) {
codeSignOnWindows(packagedAppPath)
codeSignOnMac(packagedAppPath)
} else {
console.log('Skipping code-signing. Specify the --code-sign option to perform code-signing'.gray)
}
}
} else if (process.platform === 'linux') {
if (argv.createDebianPackage) {
createDebianPackage(packagedAppPath)
} else {
console.log('Skipping creating debian package. Specify the --create-debian-package option to create it.'.gray)
case 'win32': {
if (argv.codeSign) {
codeSignOnWindows(path.join(packagedAppPath, 'Atom.exe'))
} else {
console.log('Skipping code-signing. Specify the --code-sign option to perform code-signing'.gray)
}
if (argv.createWindowsInstaller) {
return createWindowsInstaller(packagedAppPath)
.then(() => argv.codeSign && codeSignOnWindows(path.join(CONFIG.buildOutputPath, 'AtomSetup.exe')))
.then(() => packagedAppPath)
} else {
console.log('Skipping creating installer. Specify the --create-windows-installer option to create a Squirrel-based Windows installer.'.gray)
}
}
case 'linux': {
if (argv.createDebianPackage) {
createDebianPackage(packagedAppPath)
} else {
console.log('Skipping creating debian package. Specify the --create-debian-package option to create it.'.gray)
}
if (argv.createRpmPackage) {
createRpmPackage(packagedAppPath)
} else {
console.log('Skipping creating rpm package. Specify the --create-rpm-package option to create it.'.gray)
if (argv.createRpmPackage) {
createRpmPackage(packagedAppPath)
} else {
console.log('Skipping creating rpm package. Specify the --create-rpm-package option to create it.'.gray)
}
}
}