Skip to content

Commit 33c0112

Browse files
cipolleschifacebook-github-bot
authored andcommitted
Configure gradle to publish RNDependencies to Maven (facebook#49749)
Summary: Pull Request resolved: facebook#49749 This change configures gradle and CI to properly publish the RNDependencies artifacts to Maven Central ## Changelog [Internal] - Configure gradle to publish on Maven Central Reviewed By: cortinico Differential Revision: D70390191 fbshipit-source-id: fc1e1070325240584cb07fb17e58118c4c583fa9
1 parent c99b2a4 commit 33c0112

File tree

6 files changed

+67
-5
lines changed

6 files changed

+67
-5
lines changed

.github/actions/build-npm-package/action.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,14 @@ runs:
101101
cp ${{ inputs.hermes-ws-dir }}/hermes-runtime-darwin/hermes-ios-Release.tar.gz ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-ios-release.tar.gz
102102
cp ${{ inputs.hermes-ws-dir }}/dSYM/Debug/hermes.framework.dSYM ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-framework-dSYM-debug.tar.gz
103103
cp ${{ inputs.hermes-ws-dir }}/dSYM/Release/hermes.framework.dSYM ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-framework-dSYM-release.tar.gz
104+
- name: Download ReactNativeDependencies
105+
uses: actions/download-artifact@v4
106+
with:
107+
pattern: ReactNativeDependencies*
108+
path: ./packages/react-native/ReactAndroid/external-artifacts/artifacts/
109+
- name: Print Artifacts Directory
110+
shell: bash
111+
run: ls -lR ./packages/react-native/ReactAndroid/external-artifacts/artifacts/
104112
- name: Setup node.js
105113
uses: ./.github/actions/setup-node
106114
- name: Setup gradle

.github/workflows/nightly.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ jobs:
168168
build_hermesc_linux,
169169
build_hermesc_windows,
170170
build_android,
171+
prebuild_apple_dependencies,
171172
]
172173
container:
173174
image: reactnativecommunity/react-native-android:latest
@@ -186,7 +187,7 @@ jobs:
186187
steps:
187188
- name: Checkout
188189
uses: actions/checkout@v4
189-
- name: Build and Publish NPM PAckage
190+
- name: Build and Publish NPM Package
190191
uses: ./.github/actions/build-npm-package
191192
with:
192193
hermes-ws-dir: ${{ env.HERMES_WS_DIR }}

.github/workflows/prebuild-ios.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,16 +151,30 @@ jobs:
151151
- name: Rename XCFramework
152152
if: steps.restore-xcframework.outputs.cache-hit != 'true'
153153
run: mv packages/react-native/third-party/ReactNativeDependencies.xcframework packages/react-native/third-party/ReactNativeDependencies${{ matrix.flavor }}.xcframework
154+
- name: Show Symbol folder content
155+
if: steps.restore-xcframework.outputs.cache-hit != 'true'
156+
run: ls -lR packages/react-native/third-party/Symbols
157+
- name: Rename dSYM
158+
if: steps.restore-xcframework.outputs.cache-hit != 'true'
159+
run: |
160+
cp -R \
161+
packages/react-native/third-party/Symbols/ReactNativeDependencies.framework.dSYM \
162+
packages/react-native/third-party/Symbols/ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM
163+
rm -rf packages/react-native/third-party/Symbols/ReactNativeDependencies.framework.dSYM
154164
- name: Upload XCFramework Artifact
155165
uses: actions/upload-artifact@v4
156166
with:
157167
name: ReactNativeDependencies${{ matrix.flavor }}.xcframework
168+
path: packages/react-native/third-party/ReactNativeDependencies${{ matrix.flavor }}.xcframework
169+
- name: Upload dSYM Artifact
170+
uses: actions/upload-artifact@v4
171+
with:
172+
name: ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM
158173
path: |
159-
packages/react-native/third-party/ReactNativeDependencies${{ matrix.flavor }}.xcframework
174+
packages/react-native/third-party/Symbols/ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM
160175
- name: Save XCFramework in Cache
161176
if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode
162177
uses: actions/cache/save@v4
163178
with:
164-
path: |
165-
packages/react-native/third-party/ReactNativeDependencies${{ matrix.flavor }}.xcframework
179+
path: packages/react-native/third-party/ReactNativeDependencies${{ matrix.flavor }}.xcframework
166180
key: v1-ios-dependencies-xcframework-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuilds/configuration.js') }}

.github/workflows/publish-release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ jobs:
164164
build_hermesc_linux,
165165
build_hermesc_windows,
166166
build_android,
167+
prebuild_apple_dependencies,
167168
]
168169
container:
169170
image: reactnativecommunity/react-native-android:latest
@@ -186,7 +187,7 @@ jobs:
186187
with:
187188
fetch-depth: 0
188189
fetch-tags: true
189-
- name: Build and Publish NPM PAckage
190+
- name: Build and Publish NPM Package
190191
uses: ./.github/actions/build-npm-package
191192
with:
192193
hermes-ws-dir: ${{ env.HERMES_WS_DIR }}

.github/workflows/test-all.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,7 @@ jobs:
492492
build_hermesc_linux,
493493
build_hermesc_windows,
494494
build_android,
495+
prebuild_apple_dependencies,
495496
]
496497
container:
497498
image: reactnativecommunity/react-native-android:latest

packages/react-native/ReactAndroid/external-artifacts/build.gradle.kts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,41 @@ val hermesDSYMReleaseArtifact: PublishArtifact =
5353
classifier = "hermes-framework-dSYM-release"
5454
}
5555

56+
val reactNativeDependenciesDebugArtifactFile: RegularFile =
57+
layout.projectDirectory.file("artifacts/ReactNativeDependenciesDebug.xcframework")
58+
val reactNativeDependenciesDebugArtifact: PublishArtifact =
59+
artifacts.add("externalArtifacts", reactNativeDependenciesDebugArtifactFile) {
60+
type = "xcframework"
61+
extension = "xcframework"
62+
classifier = "reactnative-dependencies-debug"
63+
}
64+
65+
val reactNativeDependenciesReleaseArtifactFile: RegularFile =
66+
layout.projectDirectory.file("artifacts/ReactNativeDependenciesRelease.xcframework")
67+
val reactNativeDependenciesReleaseArtifact: PublishArtifact =
68+
artifacts.add("externalArtifacts", reactNativeDependenciesReleaseArtifactFile) {
69+
type = "xcframework"
70+
extension = "xcframework"
71+
classifier = "reactnative-dependencies-release"
72+
}
73+
val reactNativeDependenciesDebugDSYMArtifactFile: RegularFile =
74+
layout.projectDirectory.file("artifacts/ReactNativeDependenciesDebug.framework.dSYM")
75+
val reactNativeDependenciesDebugDSYMArtifact: PublishArtifact =
76+
artifacts.add("externalArtifacts", reactNativeDependenciesDebugArtifactFile) {
77+
type = "dSYM"
78+
extension = "dSYM"
79+
classifier = "reactnative-dependencies-debug-dSYM"
80+
}
81+
82+
val reactNativeDependenciesReleaseDSYMArtifactFile: RegularFile =
83+
layout.projectDirectory.file("artifacts/ReactNativeDependenciesRelease.framework.dSYM")
84+
val reactNativeDependenciesReleaseDSYMArtifact: PublishArtifact =
85+
artifacts.add("externalArtifacts", reactNativeDependenciesReleaseArtifactFile) {
86+
type = "dSYM"
87+
extension = "dSYM"
88+
classifier = "reactnative-dependencies-release-dSYM"
89+
}
90+
5691
apply(from = "../publish.gradle")
5792

5893
publishing {
@@ -63,6 +98,8 @@ publishing {
6398
artifact(hermesiOSReleaseArtifact)
6499
artifact(hermesDSYMDebugArtifact)
65100
artifact(hermesDSYMReleaseArtifact)
101+
artifact(reactNativeDependenciesDebugArtifact)
102+
artifact(reactNativeDependenciesReleaseArtifact)
66103
}
67104
}
68105
}

0 commit comments

Comments
 (0)