Skip to content

Commit afcf94a

Browse files
trop[bot]ckerr
authored andcommitted
Add a tag to libchromiumcontent when a release is created. (electron#13025)
1 parent c42b468 commit afcf94a

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

script/release.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const assert = require('assert')
66
const fs = require('fs')
77
const { execSync } = require('child_process')
88
const GitHub = require('github')
9+
const { GitProcess } = require('dugite')
910
const nugget = require('nugget')
1011
const pkg = require('../package.json')
1112
const pkgVersion = `v${pkg.version}`
@@ -283,6 +284,7 @@ async function makeRelease (releaseToValidate) {
283284
// Fetch latest version of release before verifying
284285
draftRelease = await getDraftRelease(pkgVersion, true)
285286
await validateReleaseAssets(draftRelease)
287+
await tagLibCC()
286288
await publishRelease(draftRelease)
287289
console.log(`${pass} SUCCESS!!! Release has been published. Please run ` +
288290
`"npm run publish-to-npm" to publish release to npm.`)
@@ -451,4 +453,23 @@ async function validateChecksums (validationArgs) {
451453
`shasums defined in ${validationArgs.shaSumFile}.`)
452454
}
453455

456+
async function tagLibCC () {
457+
const tag = `electron-${pkg.version}`
458+
const libccDir = path.join(path.resolve(__dirname, '..'), 'vendor', 'libchromiumcontent')
459+
console.log(`Tagging release ${tag}.`)
460+
let tagDetails = await GitProcess.exec([ 'tag', '-a', '-m', tag, tag ], libccDir)
461+
if (tagDetails.exitCode === 0) {
462+
let pushDetails = await GitProcess.exec(['push', '--tags'], libccDir)
463+
if (pushDetails.exitCode === 0) {
464+
console.log(`${pass} Successfully tagged libchromiumcontent with ${tag}.`)
465+
} else {
466+
console.log(`${fail} Error pushing libchromiumcontent tag ${tag}: ` +
467+
`${pushDetails.stderr}`)
468+
}
469+
} else {
470+
console.log(`${fail} Error tagging libchromiumcontent with ${tag}: ` +
471+
`${tagDetails.stderr}`)
472+
}
473+
}
474+
454475
makeRelease(args.validateRelease)

0 commit comments

Comments
 (0)