Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prototype - Storing the Hermes iOS tarballs on Maven. #34812

Closed
wants to merge 1 commit into from

Conversation

cortinico
Copy link
Contributor

@cortinico cortinico commented Sep 28, 2022

Summary

I'm not going to merge this as it is, this is mostly for discussions with the community for the sake of
RFC #508 react-native-community/discussions-and-proposals#508

Here I'm setting up a :ReactAndroid:external-artifacts Gradle module which is responsible of
uploading arbitrary artifacts to Maven (Central or any other repo).

In this specific example I'm uploading the Hermes iOS tarball which is 500+ Mb.
In this module I've configured the auth with Sonatype for publishing and the GPG signing of the artifacts.

Changelog

[Internal] [Changed] - Store the iOS Hermes tarball on Maven

Testing

I've tested this in a couple of ways:

Maven Local

  1. Added the tarball in the expected location: ReactAndroid/external-artifacts/artifacts/hermes-ios.tar.gz
  2. Publish to Maven Local with: ./gradlew :ReactAndroid:external-artifacts:publishToMavenLocal
  3. Verify that the artifacts are there:
$ tree ~/.m2/repository/com/facebook/react/react-native-artifacts

/Users/ncor/.m2/repository/com/facebook/react/react-native-artifacts
├── 0.0.1
│   ├── react-native-artifacts-0.0.1-hermes-ios.gz
│   ├── react-native-artifacts-0.0.1-hermes-ios.gz.asc
│   ├── react-native-artifacts-0.0.1.pom
│   └── react-native-artifacts-0.0.1.pom.asc
└── maven-metadata-local.xml

Maven Central Staging Repository

I've pushed to a staging repository the tarball (so it's not released yet). It's currently available on:

https://oss.sonatype.org/service/local/repositories/comfacebook-3529/content/com/facebook/react/react-native-artifacts/0.0.1/react-native-artifacts-0.0.1-hermes-ios.tar.gz

(Link will expire in ~7 days).

If we were to release this to Maven Central, the final URL would be:
https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.0.1/react-native-artifacts-0.0.1-hermes-ios.tar.gz

To publish you need to:

  1. Make sure you have a Sonatype account which has push right on the com.facebook group
  2. Make sure you have a GPG key + passphrase
  3. Set the Gradle properties using environment variables as follows (or using the gradle.properties file):
export ORG_GRADLE_PROJECT_SONATYPE_USERNAME=<sonatype-username>
export ORG_GRADLE_PROJECT_SONATYPE_PASSWORD=<sonatype-password>
export ORG_GRADLE_PROJECT_SIGNING_KEY=$(cat ~/your-armored-private-key.pgp)
export ORG_GRADLE_PROJECT_SIGNING_PWD=<gpg-passphrase>
  1. Publish with ./gradlew :ReactAndroid:external-artifacts:publishAllPublicationsToMavenCentralRepository

More on this is described here: https://github.com/cortinico/kotlin-android-template#to-maven-central

Differential Revision: D39886167

Summary:
I'm not going to merge this as it is, this is mostly for discussions with the community for the sake of
RFC facebook#508 react-native-community/discussions-and-proposals#508

Here I'm setting up a :ReactAndroid:external-artifacts Gradle module which is responsible of
uploading arbitrary artifacts to Maven (Central or any other repo).

In this specific example I'm uploading the Hermes iOS tarball which is 500+ Mb.
In this module I've configured the auth with Sonatype for publishing and the GPG signing of the artifacts.

Changelog:
[Internal] [Changed] - Store the iOS Hermes tarball on Maven

Differential Revision: D39886167

fbshipit-source-id: 66edae7f83df35525dc8cccd68bb5bb3a5e02a12
@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner fb-exported labels Sep 28, 2022
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D39886167

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 7,728,343 +0
android hermes armeabi-v7a 7,131,643 +0
android hermes x86 8,035,627 +0
android hermes x86_64 8,009,014 +0
android jsc arm64-v8a 9,596,968 +0
android jsc armeabi-v7a 8,363,291 +0
android jsc x86 9,541,198 +0
android jsc x86_64 10,133,593 +0

Base commit: 7f061f8
Branch: main

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: 7f061f8
Branch: main

@cortinico cortinico marked this pull request as draft September 29, 2022 11:58
@cortinico
Copy link
Contributor Author

Closing as this was a prototype and it's effectively implemented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants