|
| 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 | + |
0 commit comments