Skip to content

Releasing new React Native AAR version to Maven Central

Benoît Lemaire edited this page Jun 3, 2021 · 2 revisions

These instructions assumes that you have the two following remotes setup for this repository

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.

Releasing a main line initial version (for example, 0.65.0)

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 the Release React Native AAR workflow and click on Run workflow. Select the 0.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 on Close. Wait a little while, while checks are performed. Once completed, the Release 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.

Releasing a patch version (for example, 0.65.1)

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.