Skip to content

Commit 64e9b24

Browse files
cortinicofacebook-github-bot
authored andcommitted
Prototype - Storing the Hermes iOS tarballs on Maven.
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
1 parent 7f061f8 commit 64e9b24

File tree

3 files changed

+97
-1
lines changed

3 files changed

+97
-1
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ project.xcworkspace
3636
/ReactAndroid/gradle/
3737
/ReactAndroid/gradlew
3838
/ReactAndroid/gradlew.bat
39+
/ReactAndroid/external-artifacts/build/
40+
/ReactAndroid/external-artifacts/artifacts/
3941
/ReactAndroid/hermes-engine/build/
4042
/ReactAndroid/hermes-engine/.cxx/
4143
/template/android/app/build/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
/*
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
plugins {
9+
id("maven-publish")
10+
id("signing")
11+
}
12+
13+
//version = parent.publishing_version
14+
version = "0.0.1" // To avoid to accidentally publish a 1000.0.0-main
15+
16+
def REPO_URL = "file://${projectDir}/../../android"
17+
configurations.maybeCreate("default")
18+
19+
// The artifact should be placed inside the `artifacts/hermes-ios.tar.gz` location.
20+
def hermesiOSArtifactFile = layout.projectDirectory.file('artifacts/hermes-ios.tar.gz')
21+
def hermesiOSArtifact = artifacts.add('default', hermesiOSArtifactFile) {
22+
type 'tgz'
23+
extension 'tar.gz'
24+
classifier 'hermes-ios'
25+
}
26+
27+
publishing {
28+
publications {
29+
artifacts(MavenPublication) {
30+
artifactId = "react-native-artifacts"
31+
groupId = GROUP
32+
artifact hermesiOSArtifact
33+
34+
pom {
35+
name = POM_NAME
36+
description = "Supporting artifacts to for the React Native framework"
37+
url = "https://github.com/facebook/react-native"
38+
39+
developers {
40+
developer {
41+
id = "facebook"
42+
name = "Facebook"
43+
}
44+
}
45+
46+
licenses {
47+
license {
48+
name = "MIT License"
49+
url = "https://github.com/facebook/react-native/blob/HEAD/LICENSE"
50+
distribution = "repo"
51+
}
52+
}
53+
54+
scm {
55+
url = "https://github.com/facebook/react-native.git"
56+
connection = "scm:git:https://github.com/facebook/react-native.git"
57+
developerConnection = "scm:git:[email protected]:facebook/react-native.git"
58+
}
59+
}
60+
}
61+
}
62+
63+
repositories {
64+
maven {
65+
name = "npm"
66+
url = REPO_URL
67+
}
68+
if (project.hasProperty("SONATYPE_USERNAME") && project.hasProperty("SONATYPE_PASSWORD")) {
69+
maven {
70+
name = "mavenCentral"
71+
url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
72+
credentials {
73+
username = SONATYPE_USERNAME
74+
password = SONATYPE_PASSWORD
75+
}
76+
}
77+
}
78+
}
79+
80+
if (!project.hasProperty("SIGNING_KEY")) {
81+
logger.info("Signing Disable as the PGP key was not found")
82+
} else {
83+
logger.info("PGP Key found - Signing enabled")
84+
signing {
85+
useInMemoryPgpKeys(SIGNING_KEY, SIGNING_PWD)
86+
sign(publishing.publications.artifacts)
87+
}
88+
}
89+
}
90+

settings.gradle.kts

+5-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ pluginManagement {
1313
}
1414
}
1515

16-
include(":ReactAndroid", ":ReactAndroid:hermes-engine", ":packages:rn-tester:android:app")
16+
include(
17+
":ReactAndroid",
18+
":ReactAndroid:hermes-engine",
19+
":ReactAndroid:external-artifacts",
20+
":packages:rn-tester:android:app")
1721

1822
// Include this to enable codegen Gradle plugin.
1923
includeBuild("packages/react-native-gradle-plugin/")

0 commit comments

Comments
 (0)