mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-15 18:56:22 +00:00
Grunt deploy ready!!!
This commit is contained in:
@@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"osx" : {
|
|
||||||
"title": "Boost Installer",
|
|
||||||
// "background": "resources/background.png",
|
|
||||||
"icon": "resources/app.icns",
|
|
||||||
"icon-size": 80,
|
|
||||||
"contents": [
|
|
||||||
{ "x": 438, "y": 344, "type": "link", "path": "/Applications" },
|
|
||||||
{ "x": 192, "y": 344, "type": "file" }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
91
gruntfile.js
91
gruntfile.js
@@ -3,6 +3,7 @@ const ChildProcess = require('child_process')
|
|||||||
const packager = require('electron-packager')
|
const packager = require('electron-packager')
|
||||||
const archiver = require('archiver')
|
const archiver = require('archiver')
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
|
const appdmg = require('appdmg')
|
||||||
|
|
||||||
module.exports = function (grunt) {
|
module.exports = function (grunt) {
|
||||||
var initConfig = {
|
var initConfig = {
|
||||||
@@ -13,7 +14,7 @@ module.exports = function (grunt) {
|
|||||||
outputDirectory: path.join(__dirname, 'dist'),
|
outputDirectory: path.join(__dirname, 'dist'),
|
||||||
authors: 'MAISIN&CO., Inc.',
|
authors: 'MAISIN&CO., Inc.',
|
||||||
exe: 'Boostnote.exe',
|
exe: 'Boostnote.exe',
|
||||||
loadingGif: path.join(__dirname, 'resources/install.gif'),
|
loadingGif: path.join(__dirname, 'resources/boostnote-install.gif'),
|
||||||
iconUrl: path.join(__dirname, 'resources/app.ico'),
|
iconUrl: path.join(__dirname, 'resources/app.ico'),
|
||||||
setupIcon: path.join(__dirname, 'resources/dmg.ico'),
|
setupIcon: path.join(__dirname, 'resources/dmg.ico'),
|
||||||
certificateFile: grunt.config.get('auth_code.win_cert_path'),
|
certificateFile: grunt.config.get('auth_code.win_cert_path'),
|
||||||
@@ -53,24 +54,43 @@ module.exports = function (grunt) {
|
|||||||
|
|
||||||
grunt.registerTask('zip', function (platform) {
|
grunt.registerTask('zip', function (platform) {
|
||||||
var done = this.async()
|
var done = this.async()
|
||||||
var archive = archiver.create('zip', {})
|
|
||||||
switch (platform) {
|
switch (platform) {
|
||||||
case 'win':
|
case 'win':
|
||||||
|
var archive = archiver.create('zip', {})
|
||||||
|
var basename = 'Boostnote-installer-win32-x64'
|
||||||
archive.file(path.join('dist/Setup.exe'), {
|
archive.file(path.join('dist/Setup.exe'), {
|
||||||
name: 'Boostnote-installer-win32-x64.exe'
|
name: basename + '.exe'
|
||||||
})
|
})
|
||||||
|
archive.finalize()
|
||||||
|
var writeStream = fs.createWriteStream(path.join('dist/' + basename + '.zip'))
|
||||||
|
archive.pipe(writeStream)
|
||||||
|
writeStream.on('close', function () {
|
||||||
|
grunt.log.writeln('Zipped!')
|
||||||
|
done()
|
||||||
|
})
|
||||||
|
break
|
||||||
|
case 'osx':
|
||||||
|
|
||||||
|
var execPath = 'zip -r -y -q dist/Boostnote.zip dist/Boostnote-darwin-x64/Boostnote.app'
|
||||||
|
grunt.log.writeln(execPath)
|
||||||
|
ChildProcess.exec(execPath,
|
||||||
|
function (err, stdout, stderr) {
|
||||||
|
grunt.log.writeln(stdout)
|
||||||
|
|
||||||
|
if (err) {
|
||||||
|
grunt.log.writeln(err)
|
||||||
|
grunt.log.writeln(stderr)
|
||||||
|
done(false)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
done()
|
||||||
|
}
|
||||||
|
)
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
done()
|
done()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
archive.finalize()
|
|
||||||
var writeStream = fs.createWriteStream(path.join('dist/Boostnote-installer-win32-x64.zip'))
|
|
||||||
archive.pipe(writeStream)
|
|
||||||
writeStream.on('close', function () {
|
|
||||||
grunt.log.writeln('Zipped!')
|
|
||||||
done()
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
grunt.registerTask('pack', function (platform) {
|
grunt.registerTask('pack', function (platform) {
|
||||||
@@ -132,6 +152,53 @@ module.exports = function (grunt) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
grunt.registerTask('codesign', function (platform) {
|
||||||
|
var done = this.async()
|
||||||
|
if (process.platform !== 'darwin') {
|
||||||
|
done(false)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
ChildProcess.exec('codesign --verbose --deep --force --sign \"\" dist/Boostnote-darwin-x64/Boostnote.app', function (err, stdout, stderr) {
|
||||||
|
grunt.log.writeln(stdout)
|
||||||
|
|
||||||
|
if (err) {
|
||||||
|
grunt.log.writeln(err)
|
||||||
|
grunt.log.writeln(stderr)
|
||||||
|
done(false)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
done()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
grunt.registerTask('create-osx-installer', function () {
|
||||||
|
var done = this.async()
|
||||||
|
|
||||||
|
var stream = appdmg({
|
||||||
|
target: 'dist/Boostnote-darwin-x64.dmg',
|
||||||
|
basepath: __dirname,
|
||||||
|
specification: {
|
||||||
|
'title': 'Boostnote',
|
||||||
|
'icon': 'resources/dmg.icns',
|
||||||
|
'background': 'resources/boostnote-install.png',
|
||||||
|
'icon-size': 80,
|
||||||
|
'contents': [
|
||||||
|
{ 'x': 448, 'y': 344, 'type': 'link', 'path': '/Applications' },
|
||||||
|
{ 'x': 192, 'y': 344, 'type': 'file', 'path': 'dist/Boostnote-darwin-x64/Boostnote.app' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
stream.on('finish', function () {
|
||||||
|
done()
|
||||||
|
})
|
||||||
|
|
||||||
|
stream.on('error', function (err) {
|
||||||
|
grunt.log.writeln(err)
|
||||||
|
done(false)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
grunt.registerTask('build', function (platform) {
|
grunt.registerTask('build', function (platform) {
|
||||||
if (!platform) {
|
if (!platform) {
|
||||||
platform = process.platform === 'darwin' ? 'osx' : process.platform === 'win32' ? 'win' : null
|
platform = process.platform === 'darwin' ? 'osx' : process.platform === 'win32' ? 'win' : null
|
||||||
@@ -139,6 +206,10 @@ module.exports = function (grunt) {
|
|||||||
switch (platform) {
|
switch (platform) {
|
||||||
case 'win':
|
case 'win':
|
||||||
grunt.task.run(['pack:win', 'create-windows-installer', 'zip:win'])
|
grunt.task.run(['pack:win', 'create-windows-installer', 'zip:win'])
|
||||||
|
break
|
||||||
|
case 'osx':
|
||||||
|
grunt.task.run(['pack:osx', 'codesign', 'create-osx-installer', 'zip:osx'])
|
||||||
|
break
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -7,9 +7,6 @@
|
|||||||
"start": "electron ./index.js",
|
"start": "electron ./index.js",
|
||||||
"hot": "electron ./index.js --hot",
|
"hot": "electron ./index.js --hot",
|
||||||
"webpack": "webpack-dev-server --hot --inline --config webpack.config.js",
|
"webpack": "webpack-dev-server --hot --inline --config webpack.config.js",
|
||||||
"codesign": "codesign --verbose --deep --force --sign \"MAISIN solutions Inc.\" dist/Boost-darwin-x64/Boost.app",
|
|
||||||
"build:osx": "electron-builder \"dist/Boost-darwin-x64/Boost.app\" --platform=osx --out=\"dist\" --config=\"./builder-config.json\"",
|
|
||||||
"release": "electron-release --app=\"dist/Boost-darwin-x64/Boost.app\" --token=$(cat .env/.github-token) --repo=\"BoostIO/boost-releases\""
|
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"electron-version": "0.35.4"
|
"electron-version": "0.35.4"
|
||||||
@@ -36,6 +33,7 @@
|
|||||||
"homepage": "https://github.com/Rokt33r/codexen-app#readme",
|
"homepage": "https://github.com/Rokt33r/codexen-app#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@rokt33r/node-ipc": "^5.0.4",
|
"@rokt33r/node-ipc": "^5.0.4",
|
||||||
|
"appdmg": "^0.3.5",
|
||||||
"devicon": "^2.0.0",
|
"devicon": "^2.0.0",
|
||||||
"electron-gh-releases": "^2.0.2",
|
"electron-gh-releases": "^2.0.2",
|
||||||
"font-awesome": "^4.3.0",
|
"font-awesome": "^4.3.0",
|
||||||
|
|||||||
BIN
resources/boostnote-install.gif
Executable file
BIN
resources/boostnote-install.gif
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 138 KiB |
BIN
resources/boostnote-install.png
Executable file
BIN
resources/boostnote-install.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 234 KiB |
BIN
resources/boostnote-install@2x.png
Executable file
BIN
resources/boostnote-install@2x.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 837 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 22 KiB |
Reference in New Issue
Block a user