forked from facebook/react-native
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
1 parent
7f061f8
commit 64e9b24
Showing
3 changed files
with
97 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
plugins { | ||
id("maven-publish") | ||
id("signing") | ||
} | ||
|
||
//version = parent.publishing_version | ||
version = "0.0.1" // To avoid to accidentally publish a 1000.0.0-main | ||
|
||
def REPO_URL = "file://${projectDir}/../../android" | ||
configurations.maybeCreate("default") | ||
|
||
// The artifact should be placed inside the `artifacts/hermes-ios.tar.gz` location. | ||
def hermesiOSArtifactFile = layout.projectDirectory.file('artifacts/hermes-ios.tar.gz') | ||
def hermesiOSArtifact = artifacts.add('default', hermesiOSArtifactFile) { | ||
type 'tgz' | ||
extension 'tar.gz' | ||
classifier 'hermes-ios' | ||
} | ||
|
||
publishing { | ||
publications { | ||
artifacts(MavenPublication) { | ||
artifactId = "react-native-artifacts" | ||
groupId = GROUP | ||
artifact hermesiOSArtifact | ||
|
||
pom { | ||
name = POM_NAME | ||
description = "Supporting artifacts to for the React Native framework" | ||
url = "https://github.com/facebook/react-native" | ||
|
||
developers { | ||
developer { | ||
id = "facebook" | ||
name = "Facebook" | ||
} | ||
} | ||
|
||
licenses { | ||
license { | ||
name = "MIT License" | ||
url = "https://github.com/facebook/react-native/blob/HEAD/LICENSE" | ||
distribution = "repo" | ||
} | ||
} | ||
|
||
scm { | ||
url = "https://github.com/facebook/react-native.git" | ||
connection = "scm:git:https://github.com/facebook/react-native.git" | ||
developerConnection = "scm:git:[email protected]:facebook/react-native.git" | ||
} | ||
} | ||
} | ||
} | ||
|
||
repositories { | ||
maven { | ||
name = "npm" | ||
url = REPO_URL | ||
} | ||
if (project.hasProperty("SONATYPE_USERNAME") && project.hasProperty("SONATYPE_PASSWORD")) { | ||
maven { | ||
name = "mavenCentral" | ||
url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" | ||
credentials { | ||
username = SONATYPE_USERNAME | ||
password = SONATYPE_PASSWORD | ||
} | ||
} | ||
} | ||
} | ||
|
||
if (!project.hasProperty("SIGNING_KEY")) { | ||
logger.info("Signing Disable as the PGP key was not found") | ||
} else { | ||
logger.info("PGP Key found - Signing enabled") | ||
signing { | ||
useInMemoryPgpKeys(SIGNING_KEY, SIGNING_PWD) | ||
sign(publishing.publications.artifacts) | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters