Skip to content

Instantly share code, notes, and snippets.

@kopax
Created May 24, 2018 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kopax/6202e5d525a090eb9f85f1ecfd120558 to your computer and use it in GitHub Desktop.
Save kopax/6202e5d525a090eb9f85f1ecfd120558 to your computer and use it in GitHub Desktop.
wrap.js
if (filesToCommit.length > 0) {
logger.log('Found %d file(s) to commit', filesToCommit.length);
await add(filesToCommit);
debug('commited files: %o', filesToCommit);
const skipCi = temporaryBranch && temporarySkipCi ? '' : '[skip ci]';
await commit(
message
? template(message)({branch, lastRelease, nextRelease})
: `chore(release): ${nextRelease.version} ${skipCi}\n\n${nextRelease.notes}`
);
}
if (temporaryBranch) {
logger.log('Creating temporary branch: %s', temporaryBranch);
await gitCheckout(temporaryBranch, true);
}
logger.log('Creating tag %s', nextRelease.gitTag);
await push(repositoryUrl, temporaryBranch ? temporaryBranch : branch);
logger.log('Prepared Git release: %s', nextRelease.gitTag);
if (temporaryBranch) {
logger.log('Deleting temporary branch: %s', temporaryBranch);
await gitCheckout(branch, false);
await deleteBranch(repositoryUrl, temporaryBranch);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment