mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-27 19:25:11 +08:00
Version release script
Summary:npm-publish.js is not cohesive enough: besides building and publishing it also modifies some files. It is better to have a separate script that will bump versions, make a commit and tag it. scripts/bump-oss-version.js does exactly that. This simplifies release process and allows manual release to npm if CI is not available. Closes https://github.com/facebook/react-native/pull/6625 Differential Revision: D3092849 fb-gh-sync-id: 92cf38bd3df31c8c9c433fc5f9e15c129855fe0e shipit-source-id: 92cf38bd3df31c8c9c433fc5f9e15c129855fe0e
This commit is contained in:
committed by
Facebook Github Bot 4
parent
0f62dcecf5
commit
aec90bb46b
@@ -90,11 +90,6 @@ if (javaVersion.indexOf(requiredJavaVersion) === -1) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (sed(`-i`, /^VERSION_NAME=[0-9\.]*-SNAPSHOT/, `VERSION_NAME=${releaseVersion}`, `ReactAndroid/gradle.properties`).code) {
|
||||
echo(`Couldn't update version for Gradle`);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Uncomment Javadoc generation
|
||||
if (sed(`-i`, `// archives androidJavadocJar`, `archives androidJavadocJar`, `ReactAndroid/release.gradle`).code) {
|
||||
echo(`Couldn't enable Javadoc generation`);
|
||||
@@ -106,6 +101,9 @@ if (exec(`./gradlew :ReactAndroid:installArchives`).code) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// undo uncommenting javadoc setting
|
||||
exec(`git checkout ReactAndroid/gradle.properties`);
|
||||
|
||||
echo("Generated artifacts for Maven");
|
||||
|
||||
let artifacts = ['-javadoc.jar', '-sources.jar', '.aar', '.pom'].map((suffix) => {
|
||||
@@ -119,23 +117,6 @@ artifacts.forEach((name) => {
|
||||
}
|
||||
});
|
||||
|
||||
// ----------- Reverting changes to local files
|
||||
|
||||
exec(`git checkout ReactAndroid/gradle.properties`);
|
||||
exec(`git checkout ReactAndroid/release.gradle`);
|
||||
|
||||
|
||||
if (exec(`npm version --no-git-tag-version ${releaseVersion}`).code) {
|
||||
echo(`Couldn't update version for npm`);
|
||||
exit(1);
|
||||
}
|
||||
if (sed(`-i`, `s.version = "0.0.1-master"`, `s.version = \"${releaseVersion}\"`, `React.podspec`).code) {
|
||||
echo(`Couldn't update version for React.podspec`);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// shrinkwrapping without dev dependencies
|
||||
exec(`npm shrinkwrap`);
|
||||
if (releaseVersion.indexOf(`-rc`) === -1) {
|
||||
// release, package will be installed by default
|
||||
exec(`npm publish`);
|
||||
@@ -144,9 +125,6 @@ if (releaseVersion.indexOf(`-rc`) === -1) {
|
||||
exec(`npm publish --tag next`);
|
||||
}
|
||||
|
||||
exec(`git checkout package.json`);
|
||||
exec(`git checkout React.podspec`);
|
||||
|
||||
echo(`Published to npm ${releaseVersion}`);
|
||||
|
||||
exit(0);
|
||||
|
||||
Reference in New Issue
Block a user