diff --git a/scripts/release/publish.js b/scripts/release/publish.js index 202ce990..41e4747b 100644 --- a/scripts/release/publish.js +++ b/scripts/release/publish.js @@ -8,32 +8,25 @@ const args = process.argv.slice(2); const version = args[0]; const skipGit = args[1] === '--skip-git'; -const releaseCommands = [ - // use lerna to bump versions and dependencies - `./node_modules/.bin/lerna publish --skip-git --skip-npm --repo-version ${version} --yes` -]; +console.log(`Publishing ${version}`); + +// use lerna to bump versions and dependencies +execSync(`./node_modules/.bin/lerna publish --skip-git --skip-npm --repo-version ${version} --yes`); if (!skipGit) { - releaseCommands.push( - ...[ - // add changes - 'git add .', - // commit - `git commit -m "${version}"`, - // tag - `git tag -m ${version} "${version}"` - ] - ); + // add changes + execSync('git add .'); + // commit + execSync(`git commit -m "${version}" --no-verify`); + // tag + execSync(`git tag -m ${version} "${version}"`); } -// publish to npm -releaseCommands.push('cd packages/babel-plugin-react-native-web && npm publish'); -releaseCommands.push('cd ../react-native-web && npm publish'); +// publish to npm (expect plugin to error as version won't change often) +execSync('cd packages/react-native-web && npm publish'); +execSync('cd packages/babel-plugin-react-native-web && npm publish'); if (!skipGit) { // push to github - releaseCommands.push('git push --tags origin master'); + execSync('git push --tags origin master'); } - -console.log(`Publishing ${version}`); -execSync(releaseCommands.join(' && '));