From 6f142841b963fce5884895cd6166262b25362500 Mon Sep 17 00:00:00 2001 From: Everton Fraga Date: Wed, 15 Nov 2017 16:44:12 -0500 Subject: [PATCH 1/2] Auto-generating SHA256 checksums --- gulpTasks/publishing.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/gulpTasks/publishing.js b/gulpTasks/publishing.js index 6207c6d6b..06d45a8b7 100644 --- a/gulpTasks/publishing.js +++ b/gulpTasks/publishing.js @@ -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) => { @@ -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); }); } }) From 7141a00c5c842c04a0be74a175a3007c1dc9a433 Mon Sep 17 00:00:00 2001 From: Everton Fraga Date: Wed, 15 Nov 2017 16:53:56 -0500 Subject: [PATCH 2/2] Formatting checksum table contents --- gulpTasks/publishing.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulpTasks/publishing.js b/gulpTasks/publishing.js index 06d45a8b7..9556f6467 100644 --- a/gulpTasks/publishing.js +++ b/gulpTasks/publishing.js @@ -93,7 +93,7 @@ gulp.task('upload-binaries', (cb) => { // 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]}`; + return `${line[1]} | \`${line[0]}\``; }).join('\n')) }) });