mirror of
https://github.com/zhigang1992/react-native-web.git
synced 2026-05-15 07:37:43 +08:00
Disable husky on version commit. Current publish script doesn't account for attempts to republish the same version.
33 lines
851 B
JavaScript
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');
|
|
}
|