Add Jenkins CI (#1486)
* add jenkins ci file * add try/catch and process.exit
This commit is contained in:
parent
54dc4f94e3
commit
7b7e7eaae2
|
@ -0,0 +1,19 @@
|
|||
pipeline {
|
||||
agent {
|
||||
node {
|
||||
label 'master'
|
||||
}
|
||||
}
|
||||
stages {
|
||||
stage('Install') {
|
||||
steps {
|
||||
sh 'npm install'
|
||||
}
|
||||
}
|
||||
stage('Build') {
|
||||
steps {
|
||||
sh 'npm run build:electron'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -33,41 +33,46 @@ async function build() {
|
|||
);
|
||||
|
||||
console.log('Building...');
|
||||
await builder.build({
|
||||
mac: shouldBuildOs('mac') ? ['zip', 'dmg'] : undefined,
|
||||
win: shouldBuildOs('windows') ? ['nsis'] : undefined,
|
||||
linux: shouldBuildOs('linux') ? ['AppImage'] : undefined,
|
||||
x64: true,
|
||||
ia32: true,
|
||||
config: {
|
||||
appId: 'com.github.mycrypto.mycryptohq',
|
||||
productName: 'MyCrypto',
|
||||
directories: {
|
||||
app: jsBuildDir,
|
||||
output: electronBuildsDir
|
||||
},
|
||||
mac: {
|
||||
category: 'public.app-category.finance',
|
||||
icon: path.join(config.path.electron, 'icons/icon.icns'),
|
||||
compression
|
||||
},
|
||||
win: {
|
||||
icon: path.join(config.path.electron, 'icons/icon.ico'),
|
||||
compression
|
||||
},
|
||||
linux: {
|
||||
category: 'Finance',
|
||||
icon: path.join(config.path.electron, 'icons/icon.png'),
|
||||
compression
|
||||
},
|
||||
// IMPORTANT: Prevents from auto publishing to GitHub in CI environments
|
||||
publish: null,
|
||||
// IMPORTANT: Prevents extending configs in node_modules
|
||||
extends: null
|
||||
}
|
||||
});
|
||||
try {
|
||||
await builder.build({
|
||||
mac: shouldBuildOs('mac') ? ['zip', 'dmg'] : undefined,
|
||||
win: shouldBuildOs('windows') ? ['nsis'] : undefined,
|
||||
linux: shouldBuildOs('linux') ? ['AppImage'] : undefined,
|
||||
x64: true,
|
||||
ia32: true,
|
||||
config: {
|
||||
appId: 'com.github.mycrypto.mycryptohq',
|
||||
productName: 'MyCrypto',
|
||||
directories: {
|
||||
app: jsBuildDir,
|
||||
output: electronBuildsDir
|
||||
},
|
||||
mac: {
|
||||
category: 'public.app-category.finance',
|
||||
icon: path.join(config.path.electron, 'icons/icon.icns'),
|
||||
compression
|
||||
},
|
||||
win: {
|
||||
icon: path.join(config.path.electron, 'icons/icon.ico'),
|
||||
compression
|
||||
},
|
||||
linux: {
|
||||
category: 'Finance',
|
||||
icon: path.join(config.path.electron, 'icons/icon.png'),
|
||||
compression
|
||||
},
|
||||
// IMPORTANT: Prevents from auto publishing to GitHub in CI environments
|
||||
publish: null,
|
||||
// IMPORTANT: Prevents extending configs in node_modules
|
||||
extends: null
|
||||
}
|
||||
});
|
||||
|
||||
console.info(`Electron builds are finished! Available at ${electronBuildsDir}`);
|
||||
console.info(`Electron builds are finished! Available at ${electronBuildsDir}`);
|
||||
} catch(err) {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
build();
|
||||
|
|
Loading…
Reference in New Issue