-
Notifications
You must be signed in to change notification settings - Fork 0
Releasing new React Native AAR version to Maven Central
These instructions assumes that you have the two following remotes setup for this repository
-
upstream
, pointing to official React Native repository (https://github.com/facebook/react-native) -
origin
, pointing to this fork (https://github.com/electrode-io/react-native) Your remotes can be named differently, but if that's the case, just make sure to perform proper substitutions in the following instructions.
React Native is using 0.XX-stable
branches for main versions lines. For example, for 0.64.X
versions, the branch will be 0.64-stable
.
Releases are git tagged as v0.64.0
, v0.64.1
... and so on.
Assuming React Native team just released v0.65.0, here are the instructions to release the corresponding AAR to Maven Central. Please replace the version in these instructions to whichever version you are releasing.
-
Fetch all new branches from origin (to get the new
0.65-stable
branch locally)
git fetch upstream
-
Checkout the branch locally to add custom modifications to it
git checkout 0.65-stable
-
Add the release-aar GitHub Action Workflow on this branch (this workflow is custom made for ERN, and not part of the official repo)
git cherry-pick 41ead3f
-
Perform the necessary updates to
ReactAndroid/release.gradle
file to add the necessary for publication to remote Maven
git cherry-pick 036fd88
-
Push the update branch to this fork
git push origin 0.65-stable
-
From this repository on GitHub, click on
Actions
, then select theRelease React Native AAR
workflow and click onRun workflow
. Select the0.65-stable
branch. -
Once workflow is completed, the AAR Maven artifact will have been uploaded to sonatype (https://oss.sonatype.org). Just login using the right credentials, click on
Staging Repository
, select the artifact and click onClose
. Wait a little while, while checks are performed. Once completed, theRelease
button will be available. Just click on it, (check auto drop repository) , confirm. -
Wait for a little while for the artifact to propagate to Maven Central (usually around 30 minutes, but can take longer). Once you see the version in the list HERE it means its available in Maven Central.
To release a patch version, assuming all above instructions have been already completed to release the initial main line version, all that is needed is to bring the latest changes from the 0.65-stable
official branches to the 0.65-stable
forked branch in this repo, and trigger the release-aar workflow.
-
Get the latest changes from upstream branch
git checkout 0.65-stable
git pull upstream 0.65-stable
-
Push the branch to this fork
git push origin 0.65-stable
Then follow the same instructions as above to trigger release-aar workflow and release artifact to maven central.