Skip to content
This repository has been archived by the owner on Jun 11, 2021. It is now read-only.

Commit

Permalink
Circle linux added to get some artifacts
Browse files Browse the repository at this point in the history
Circle linux added to get some artifacts
  • Loading branch information
FrenchBen committed May 27, 2016
2 parents 1694744 + 2bdaddd commit b5636fb
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 17 deletions.
41 changes: 24 additions & 17 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ module.exports = function (grunt) {
var OSX_OUT = './dist';
var OSX_OUT_X64 = OSX_OUT + '/' + OSX_APPNAME + '-darwin-x64';
var OSX_FILENAME = OSX_OUT_X64 + '/' + OSX_APPNAME + '.app';
var LINUX_FILENAME = OSX_OUT + '/' + BASENAME + '_' + packagejson.version + '_amd64.deb';


var IS_WINDOWS = process.platform === 'win32';
var IS_LINUX = process.platform === 'linux';
Expand All @@ -37,10 +39,26 @@ module.exports = function (grunt) {
var IS_DEB = fs.existsSync('/etc/lsb-release') || fs.existsSync('/etc/debian_version');
var IS_RPM = fs.existsSync('/etc/redhat-release');

var linuxpackage = null;
// linux package detection
if (IS_DEB && IS_X64) {
linuxpackage = 'electron-installer-debian:linux64';
} else if (IS_DEB && IS_I386) {
linuxpackage = 'electron-installer-debian:linux32';
LINUX_FILENAME = OSX_OUT + '/' + BASENAME + '_' + packagejson.version + '_i386.deb';
} else if (IS_RPM && IS_X64) {
linuxpackage = 'electron-installer-redhat:linux64';
LINUX_FILENAME = OSX_OUT + '/' + BASENAME + '_' + packagejson.version + '_x86_64.rpm';
} else if (IS_RPM && IS_I386) {
linuxpackage = 'electron-installer-redhat:linux32';
LINUX_FILENAME = OSX_OUT + '/' + BASENAME + '_' + packagejson.version + '_x86.rpm';
}

grunt.initConfig({
IDENTITY: 'Developer ID Application: Docker Inc',
OSX_FILENAME: OSX_FILENAME,
OSX_FILENAME_ESCAPED: OSX_FILENAME.replace(/ /g, '\\ ').replace(/\(/g, '\\(').replace(/\)/g, '\\)'),
LINUX_FILENAME: LINUX_FILENAME,

// electron
electron: {
Expand Down Expand Up @@ -224,6 +242,9 @@ module.exports = function (grunt) {
},
linux_npm: {
command: 'cd build && npm install --production'
},
linux_zip: {
command: 'ditto -c -k --sequesterRsrc --keepParent <%= LINUX_FILENAME %> release/' + BASENAME + '-Ubuntu.deb'
}
},

Expand Down Expand Up @@ -310,7 +331,7 @@ module.exports = function (grunt) {
'Utility'
],
rename: function (dest, src) {
return dest + '<%= name %>_' + packagejson.version + '-<%= revision %>_<%= arch %>.deb';
return LINUX_FILENAME;
}
},
linux64: {
Expand Down Expand Up @@ -338,7 +359,7 @@ module.exports = function (grunt) {
'Utilities'
],
rename: function (dest, src) {
return dest + '<%= name %>_' + packagejson.version + '-<%= revision %>_<%= arch %>.rpm';
return LINUX_FILENAME;
}
},
linux64: {
Expand Down Expand Up @@ -366,27 +387,13 @@ module.exports = function (grunt) {
grunt.registerTask('default', ['newer:babel', 'less', 'newer:copy:dev', 'shell:electron', 'watchChokidar']);

if (!IS_WINDOWS && !IS_LINUX) {
grunt.registerTask('release', ['clean:release', 'babel', 'less', 'copy:dev', 'electron', 'copy:osx', 'shell:sign', 'shell:zip', 'copy:windows', 'rcedit:exes', 'compress', 'shell:linux_npm', 'electron-packager:osxlnx', 'electron-installer-debian:linux64']);
grunt.registerTask('release', ['clean:release', 'babel', 'less', 'copy:dev', 'electron', 'copy:osx', 'shell:sign', 'shell:zip', 'copy:windows', 'rcedit:exes', 'compress', 'shell:linux_npm', 'electron-packager:osxlnx', 'electron-installer-debian:linux64', 'shell:linux_zip']);
}else if (IS_LINUX) {

var linuxpackage = null;
// linux package detection
if (IS_DEB && IS_X64) {
linuxpackage = 'electron-installer-debian:linux64';
} else if (IS_DEB && IS_I386) {
linuxpackage = 'electron-installer-debian:linux32';
} else if (IS_RPM && IS_X64) {
linuxpackage = 'electron-installer-redhat:linux64';
}else if (IS_RPM && IS_I386) {
linuxpackage = 'electron-installer-redhat:linux32';
}

if (linuxpackage) {
grunt.registerTask('release', ['clean:release', 'babel', 'less', 'copy:dev', 'shell:linux_npm', 'electron-packager:build', linuxpackage]);
}else {
grunt.log.errorlns('Your Linux distribution is not yet supported - arch:' + process.arch + ' platform:' + process.platform);
}

}else {
grunt.registerTask('release', ['clean:release', 'babel', 'less', 'copy:dev', 'electron:windows', 'copy:windows', 'rcedit:exes', 'compress']);
}
Expand Down
1 change: 1 addition & 0 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ deployment:
commands:
- github-release upload --user docker --repo kitematic --tag $CIRCLE_TAG --file release/Kitematic-Mac.zip --name Kitematic-$(echo $CIRCLE_TAG | cut -c2-)-Mac.zip
- github-release upload --user docker --repo kitematic --tag $CIRCLE_TAG --file release/Kitematic-Windows.zip --name Kitematic-$(echo $CIRCLE_TAG | cut -c2-)-Windows.zip
- github-release upload --user docker --repo kitematic --tag $CIRCLE_TAG --file release/Kitematic-Ubuntu.deb --name Kitematic-$(echo $CIRCLE_TAG | cut -c2-)-Ubuntu.deb
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"test": "jest -c jest-unit.json",
"integration": "jest -c jest-integration.json",
"release": "grunt release",
"release-verbose": "grunt --verbose release",
"lint": "jsxhint src"
},
"license": "Apache-2.0",
Expand Down

0 comments on commit b5636fb

Please sign in to comment.