Files
react-native-web/scripts/release/publish.js
Nicolas Gallagher 0721245b3e Patch release script
Disable husky on version commit. Current publish script doesn't account
for attempts to republish the same version.
2018-01-17 19:15:23 -08:00

33 lines
851 B
JavaScript

#!/usr/bin/env node
'use strict';
const execSync = require('child_process').execSync;
const args = process.argv.slice(2);
const version = args[0];
const skipGit = args[1] === '--skip-git';
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) {
// add changes
execSync('git add .');
// commit
execSync(`git commit -m "${version}" --no-verify`);
// tag
execSync(`git tag -m ${version} "${version}"`);
}
// 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
execSync('git push --tags origin master');
}