Skip to content
This repository has been archived by the owner on Sep 5, 2020. It is now read-only.

Sha256 checksums #2917

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 26 additions & 17 deletions gulpTasks/building.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const _ = require('underscore');
const builder = require('electron-builder');
const signer = require('electron-builder/out/windowsCodeSign').sign;
const del = require('del');
const exec = require('child_process').exec;
const fs = require('fs');
Expand Down Expand Up @@ -208,25 +209,17 @@ gulp.task('release-dist', (done) => {
_.each(options.activePlatforms, (platform) => {
switch (platform) { // eslint-disable-line default-case
case 'win':
cp(
`${applicationName}-${version}-ia32-win.zip`, `${appNameHypen}-win32-${versionDashed}.zip`);
cp(
`${applicationName}-${version}-win.zip`, `${appNameHypen}-win64-${versionDashed}.zip`);
cp(`${applicationName}-${version}-ia32-win.zip`, `${appNameHypen}-win32-${versionDashed}.zip`);
cp(`${applicationName}-${version}-win.zip`, `${appNameHypen}-win64-${versionDashed}.zip`);
break;
case 'mac':
cp(
path.join('mac', `${applicationName}-${version}.dmg`),
`${appNameHypen}-macosx-${versionDashed}.dmg`);
cp(`${applicationName}-${version}.dmg`, `${appNameHypen}-macosx-${versionDashed}.dmg`);
break;
case 'linux':
cp(
`${appNameNoSpace}_${version}_i386.deb`, `${appNameHypen}-linux32-${versionDashed}.deb`);
cp(
`${appNameNoSpace}-${version}-ia32.zip`, `${appNameHypen}-linux32-${versionDashed}.zip`);
cp(
`${appNameNoSpace}_${version}_amd64.deb`, `${appNameHypen}-linux64-${versionDashed}.deb`);
cp(
`${appNameNoSpace}-${version}.zip`, `${appNameHypen}-linux64-${versionDashed}.zip`);
cp(`${appNameNoSpace}_${version}_i386.deb`, `${appNameHypen}-linux32-${versionDashed}.deb`);
cp(`${appNameNoSpace}-${version}-ia32.zip`, `${appNameHypen}-linux32-${versionDashed}.zip`);
cp(`${appNameNoSpace}_${version}_amd64.deb`, `${appNameHypen}-linux64-${versionDashed}.deb`);
cp(`${appNameNoSpace}-${version}.zip`, `${appNameHypen}-linux64-${versionDashed}.zip`);
break;
}
});
Expand All @@ -237,11 +230,27 @@ gulp.task('release-dist', (done) => {

gulp.task('build-nsis', (cb) => {
const typeString = `-DTYPE=${type}`;
const appNameString = `-DAPPNAME=${applicationName.replace(/\s/, '-')}`;
const appNameStringDashed = applicationName.replace(/\s/, '-');
const appNameString = `-DAPPNAME=${appNameStringDashed}`;
const versionParts = version.split('.');
const versionString = `-DVERSIONMAJOR=${versionParts[0]} -DVERSIONMINOR=${versionParts[1]} -DVERSIONBUILD=${versionParts[2]}`;

const cmdString = `makensis ${versionString} ${typeString} ${appNameString} scripts/windows-installer.nsi`;

exec(cmdString, cb);
// Manually signing NSIS installer
exec(cmdString, () => {
const signInfo = {
options: {}, // default signing values will apply
path: path.join(__dirname, '..', `dist_${type}`, 'release', `${appNameStringDashed}-installer-${versionParts.join('-')}.exe`),
cert: process.env.CSC_WIN_LINK,
password: process.env.CSC_WIN_KEY_PASSWORD
};

if (process.env.CSC_WIN_LINK && process.env.CSC_WIN_KEY_PASSWORD) {
console.log('Windows installer code signing', signInfo);
signer(signInfo).then(() => cb());
} else {
cb();
}
});
});
23 changes: 13 additions & 10 deletions gulpTasks/publishing.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,11 @@ gulp.task('checksums', (cb) => {
let command;
let argument = '';

switch (process.platform) {
case 'darwin':
command = 'md5';
break;
case 'win32':
if (process.platform === 'win32') {
command = 'certUtil -hashfile';
argument = 'md5';
break;
default:
command = 'md5sum';
argument = 'SHA256';
} else {
command = 'shasum -a 256';
}

files.forEach((file) => {
Expand Down Expand Up @@ -90,14 +85,22 @@ gulp.task('upload-binaries', (cb) => {
})
// append checksums to draft text
.then(() => {
console.info('Appending checksums to release notes...', checksums);
if (draft.body && checksums) {
got.patch(`https://api.github.com/repos/ethereum/mist/releases/${draft.id}?access_token=${GITHUB_TOKEN}`, {
body: JSON.stringify({
tag_name: `v${version}`,
body: `${draft.body}\n\n## Checksums\n\`\`\`\n${checksums.join('')}\`\`\``
// String manipulation to create a checksums table
body: String.concat('File | Checksum (SHA256)\n-- | --', checksums.map((e) => {
const line = e.replace('\n', '').split(' ');
return `${line[1]} | ${line[0]}`;
}).join('\n'))
})
});
}
})
.catch((err) => {
console.log(err);
});
}
})
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Mist",
"version": "0.9.0",
"version": "0.9.1",
"license": "GPL-3.0",
"author": "Ethereum Mist Team <mist@ethereum.org>",
"repository": {
Expand Down Expand Up @@ -47,7 +47,7 @@
"del": "^2.2.2",
"ecstatic": "^2.1.0",
"electron": "1.4.15",
"electron-builder": "^12.2.2",
"electron-builder": "^19.19.1",
"eslint": "^3.14.1",
"eslint-config-airbnb-base": "^11.0.1",
"eslint-plugin-import": "^2.2.0",
Expand Down