Created
May 24, 2018 15:22
-
-
Save kopax/6202e5d525a090eb9f85f1ecfd120558 to your computer and use it in GitHub Desktop.
wrap.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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