Skip to content

Commit

Permalink
Update maven publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
rthic23 committed May 31, 2024
1 parent d724007 commit 3d17b97
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 4 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/release-aar.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release React Native AAR
# This workflow is manually triggered to release a new React Native AAR version
on:
workflow_dispatch:

jobs:
release-aar:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Publish Maven Artifact
run: |
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
yarn install
echo "signing.gnupg.keyName=${OSSRH_GPG_SECRET_KEY_ID}" >> gradle.properties
echo "signing.gnupg.passphrase=${OSSRH_GPG_SECRET_KEY_PASSWORD}" >> gradle.properties
echo "repositoryUsername=${OSSRH_SONATYPE_USERNAME}" >> gradle.properties
echo "repositoryPassword=${OSSRH_SONATYPE_PASSWORD}" >> gradle.properties
echo "signingKey=${OSSRH_GPG_SECRET_KEY}" >> gradle.properties
echo "signingPassword=${OSSRH_GPG_SECRET_KEY_PASSWORD}" >> gradle.properties
sed -i.bu 's/com.facebook.react/com.walmartlabs.ern/g' packages/react-native/ReactAndroid/gradle.properties
./gradlew assembleRelease
env:
OSSRH_GPG_SECRET_KEY_ID: ${{ secrets.OSSRH_GPG_SECRET_KEY_ID }}
OSSRH_GPG_SECRET_KEY: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
OSSRH_GPG_SECRET_KEY_PASSWORD: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
OSSRH_SONATYPE_USERNAME: ${{ secrets.OSSRH_SONATYPE_USERNAME }}
OSSRH_SONATYPE_PASSWORD: ${{ secrets.OSSRH_SONATYPE_PASSWORD }}

4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ group = "com.facebook.react"

val ndkPath by extra(System.getenv("ANDROID_NDK"))
val ndkVersion by extra(System.getenv("ANDROID_NDK_VERSION"))
val sonatypeUsername = findProperty("SONATYPE_USERNAME")?.toString()
val sonatypePassword = findProperty("SONATYPE_PASSWORD")?.toString()
val sonatypeUsername = findProperty("repositoryUsername")?.toString()
val sonatypePassword = findProperty("repositoryPassword")?.toString()

nexusPublishing {
repositories {
Expand Down
21 changes: 21 additions & 0 deletions packages/react-native/ReactAndroid/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,26 @@ FOLLY_VERSION=2021.07.22.00
GLOG_VERSION=0.3.5
LIBEVENT_VERSION=2.1.12

# Electrode Native Sonatype Publish
POM_URL=https://github.com/facebook/react-native
POM_SCM_URL=https://github.com/facebook/react-native.git
POM_SCM_CONNECTION=scm:git:https://github.com/facebook/react-native.git
POM_SCM_DEV_CONNECTION=scm:git:[email protected]:facebook/react-native.git
POM_DESCRIPTION=A framework for building native apps with React

POM_LICENCE_NAME=MIT License
POM_LICENCE_URL=https://github.com/facebook/react-native/blob/master/LICENSE
POM_LICENCE_DIST=repo

POM_DEVELOPER_ID=facebook
POM_DEVELOPER_NAME=Facebook
POM_DEVELOPER_EMAIL=[email protected]

SONATYPE_HOST=DEFAULT
RELEASE_SIGNING_ENABLED=true

REPOSITORY_URL_MAVEN_STAGING_DEFAULT=https://oss.sonatype.org/service/local/staging/deploy/maven2/
REPOSITORY_URL_MAVEN_SNAPSHOT_DEFAULT=https://oss.sonatype.org/content/repositories/snapshots/

android.useAndroidX=true
android.enableJetifier=true
4 changes: 2 additions & 2 deletions packages/react-native/ReactAndroid/publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ apply plugin: 'maven-publish'
apply plugin: 'signing'

def isNightly = findProperty("isNightly")?.toBoolean()
def signingKey = findProperty("SIGNING_KEY")
def signingPwd = findProperty("SIGNING_PWD")
def signingKey = findProperty("signingKey")
def signingPwd = findProperty("signingPassword")

def reactAndroidProjectDir = project(':packages:react-native:ReactAndroid').projectDir
def androidOutputUrl = "file://${reactAndroidProjectDir}/../android"
Expand Down

0 comments on commit 3d17b97

Please sign in to comment.