New release process: Update release script and docs

This commit is contained in:
Martin Konicek 2016-02-09 16:01:36 +00:00
parent f7468ec356
commit 8a9996c5c7
2 changed files with 4 additions and 45 deletions

View File

@ -1,36 +0,0 @@
## Ideas for improvements
We could simplify the process quite a bit by publishing the Android binaries to npm. This will increase the size of the npm package by about 3.3MB. To do that: after `installArchives`, move the binaries to somewhere where `npm publish` will pick them up. Then, change the `build.gradle` file(s) of your generated app so that Gradle will pick up the binaries from `node_modules`. This will likely also **fix issues with incompatible versions of JS and Android binaries** (e.g. [#4488](https://github.com/facebook/react-native/issues/4488)).
## Publish a release (same steps for an rc version, 0.x.0)
Publish to Maven Central (Note: **We could get rid of this whole section by publishing binaries to npm instead**):
- Log into Sonatype and go to [Staging upload](https://oss.sonatype.org/#staging-upload). You'll need to get permissions for this by filing a ticket explaining you're a core contributor to React Native. [Example ticket](https://issues.sonatype.org/browse/OSSRH-11885).
- Select Artifact(s) with a POM (to publish to a local Maven repo for testing run `./gradlew :ReactAndroid:installArchives`)
- Add all files: .aar, sources jar, javadoc jar, .asc for everything (including the POM file)
- Wait a few hours until you see the version has propagated to [JCenter](https://bintray.com/bintray/jcenter/com.facebook.react%3Areact-native/view)
To release to npm:
(You need to be a maintainer of the repo. For admins, here's the command to promote someone)
```
npm owner add <user> react-native
```
```
git tag v0.version_you_are_releasing.0-rc 0.version_you_are_releasing-stable # don't forget the `v` at the beginning!
git push --tags
```
- Publish to npm
```
npm set registry https://registry.npmjs.org/
npm publish
# *Only* when doing a non-rc release:
# npm dist-tag add react-native@0.non_rc_version.0 latest
```
- Upgrade tags to a release by going to https://github.com/facebook/react-native/tags
- Click "Add Notes to release"
- Click Publish

View File

@ -45,16 +45,13 @@ artifacts_dir=~/.m2/repository/com/facebook/react/react-native/${RELEASE}.0
for i in "${artifacts_list[@]}"; do
artifact_file="${artifacts_dir}/react-native-${RELEASE}.0${i}"
[ -e "${artifact_file}" ] || error "Couldn't find file: ${artifact_file}"
[ -e "${artifact_file}.asc" ] || error "Couldn't find file: ${artifact_file}.asc"
done
success "Generated artifacts for Maven"
sed -i.bak -E "s/(\"version\":[[:space:]]*\").+(\")/\"version\": \"${RELEASE}.0-rc\"/g" "package.json" || error "Couldn't update version for npm"
sed -i.bak -E "s/(s.version[[:space:]]{13}=[[:space:]].+)/s.version = \"${RELEASE}.0-rc\"/g" "React.podspec" || error "Couldn't update version for CocoaPods"
sed -i.bak -E "s/\"com\.facebook\.react:react-native:.+\"/\"com.facebook.react:react-native:${RELEASE}.+\"/g" "local-cli/generator-android/templates/src/app/build.gradle" || error "Couldn't update version in Android template's build.gradle"
success "Updated version numbers"
@ -82,7 +79,7 @@ react-native init "$project_name"
info "Double checking the versions in package.json and build.gradle are correct:"
grep "\"react-native\": \"\^${RELEASE}.0-rc\"" "/tmp/${project_name}/package.json" || error "Incorrect version number in /tmp/${project_name}/package.json"
grep "com.facebook.react:react-native:${RELEASE}.+" "${project_name}/android/app/build.gradle" || error "Incorrect version number in /tmp/${project_name}/android/app/build.gradle"
grep -E "com.facebook.react:react-native:\\+" "${project_name}/android/app/build.gradle" || error "Dependency in /tmp/${project_name}/android/app/build.gradle must be com.facebook.react:react-native:+"
success "New sample project generated at /tmp/${project_name}"
@ -110,11 +107,9 @@ git commit -am "[${RELEASE}.0-rc] Bump version numbers"
find . -path "*.bak" | xargs rm
info "Next steps:"
info " - Release to Maven Central: https://github.com/facebook/react-native/blob/master/Releases.md#do-a-release"
info " - git push origin ${RELEASE}-stable"
info " - git tag v${RELEASE}.0-rc ${RELEASE}-stable"
info " - git push --tags"
info " - Once the change propagates to JCenter:"
info " - npm set registry https://registry.npmjs.org/"
info " - When doing a RC release: npm publish --tag next"
info " - When doing a non-RC release: npm publish # Sets the latest tag automatically"
info " - npm set registry https://registry.npmjs.org/"
info " - When doing a RC release: npm publish --tag next"
info " - When doing a non-RC release: npm publish # Sets the latest tag automatically"