From 42ec7b317f52092d3b45186547b834b50937a543 Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Mon, 21 May 2018 14:03:23 -0400 Subject: [PATCH] Add a tag to libchromiumcontent when a release is created. (#12977) --- script/release.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/script/release.js b/script/release.js index 5e694366d..5858caf21 100755 --- a/script/release.js +++ b/script/release.js @@ -6,6 +6,7 @@ const assert = require('assert') const fs = require('fs') const { execSync } = require('child_process') const GitHub = require('github') +const { GitProcess } = require('dugite') const nugget = require('nugget') const pkg = require('../package.json') const pkgVersion = `v${pkg.version}` @@ -283,6 +284,7 @@ async function makeRelease (releaseToValidate) { // Fetch latest version of release before verifying draftRelease = await getDraftRelease(pkgVersion, true) await validateReleaseAssets(draftRelease) + await tagLibCC() await publishRelease(draftRelease) console.log(`${pass} SUCCESS!!! Release has been published. Please run ` + `"npm run publish-to-npm" to publish release to npm.`) @@ -451,4 +453,23 @@ async function validateChecksums (validationArgs) { `shasums defined in ${validationArgs.shaSumFile}.`) } +async function tagLibCC () { + const tag = `electron-${pkg.version}` + const libccDir = path.join(path.resolve(__dirname, '..'), 'vendor', 'libchromiumcontent') + console.log(`Tagging release ${tag}.`) + let tagDetails = await GitProcess.exec([ 'tag', '-a', '-m', tag, tag ], libccDir) + if (tagDetails.exitCode === 0) { + let pushDetails = await GitProcess.exec(['push', '--tags'], libccDir) + if (pushDetails.exitCode === 0) { + console.log(`${pass} Successfully tagged libchromiumcontent with ${tag}.`) + } else { + console.log(`${fail} Error pushing libchromiumcontent tag ${tag}: ` + + `${pushDetails.stderr}`) + } + } else { + console.log(`${fail} Error tagging libchromiumcontent with ${tag}: ` + + `${tagDetails.stderr}`) + } +} + makeRelease(args.validateRelease)