Skip to content

Commit 0bb6243

Browse files
cipolleschifacebook-github-bot
authored andcommitted
Compress xcframework to let sonatype sign it (facebook#49753)
Summary: Pull Request resolved: facebook#49753 Sonatype cannot sign folders. It needs a file to be signed. To make it happen, we are compressing the xcframeworks and the dSYM with tar, and we are uploading those files instead of the folders I also observed that the cache keys were not computed correctly, so I'm fixing them. ## Changelog: [Internal] - use tar.gz instad of folders for dSYM and xcframeworks Reviewed By: bvanderhoof, mofeiZ Differential Revision: D70409314 fbshipit-source-id: 20a5ee4f24b644f4f087974ad6b0831d5769b1d9
1 parent 33c0112 commit 0bb6243

File tree

2 files changed

+32
-29
lines changed

2 files changed

+32
-29
lines changed

.github/workflows/prebuild-ios.yml

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
uses: actions/cache/restore@v4
1818
with:
1919
path: packages/react-native/third-party/
20-
key: v1-ios-dependencies-${{ hashfiles('scripts/releases/ios-prebuilds/configuration.js') }}
20+
key: v1-ios-dependencies-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
2121
enableCrossOsArchive: true
2222
- name: Yarn Install
2323
if: steps.restore-ios-prebuilds.outputs.cache-hit != 'true'
@@ -39,7 +39,7 @@ jobs:
3939
uses: actions/cache/save@v4
4040
if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode
4141
with:
42-
key: v1-ios-dependencies-${{ hashfiles('scripts/releases/ios-prebuilds/configuration.js') }}
42+
key: v1-ios-dependencies-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
4343
enableCrossOsArchive: true
4444
path: packages/react-native/third-party/
4545

@@ -73,7 +73,7 @@ jobs:
7373
uses: actions/cache/restore@v4
7474
with:
7575
path: packages/react-native/third-party/.build/Build/Products
76-
key: v1-ios-dependencies-slice-folder-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuilds/configuration.js') }}
76+
key: v1-ios-dependencies-slice-folder-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
7777
- name: Yarn Install
7878
if: steps.restore-slice-folder.outputs.cache-hit != 'true'
7979
uses: ./.github/actions/yarn-install
@@ -106,7 +106,7 @@ jobs:
106106
uses: actions/cache/save@v4
107107
if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode
108108
with:
109-
key: v1-ios-dependencies-slice-folder-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuilds/configuration.js') }}
109+
key: v1-ios-dependencies-slice-folder-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
110110
enableCrossOsArchive: true
111111
path: |
112112
packages/react-native/third-party/.build/Build/Products
@@ -132,8 +132,9 @@ jobs:
132132
id: restore-xcframework
133133
uses: actions/cache/restore@v4
134134
with:
135-
path: packages/react-native/third-party/ReactNativeDependencies${{ matrix.flavor }}.xcframework
136-
key: v1-ios-dependencies-xcframework-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuilds/configuration.js') }}
135+
path: |
136+
packages/react-native/third-party/
137+
key: v1-ios-dependencies-xcframework-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
137138
# If cache hit, we already have our binary. We don't need to do anything.
138139
- name: Yarn Install
139140
if: steps.restore-xcframework.outputs.cache-hit != 'true'
@@ -148,33 +149,35 @@ jobs:
148149
- name: Create XCFramework
149150
if: steps.restore-xcframework.outputs.cache-hit != 'true'
150151
run: node scripts/releases/prepare-ios-prebuilds.js -c
151-
- name: Rename XCFramework
152+
- name: Compress and Rename XCFramework
152153
if: steps.restore-xcframework.outputs.cache-hit != 'true'
153-
run: mv packages/react-native/third-party/ReactNativeDependencies.xcframework packages/react-native/third-party/ReactNativeDependencies${{ matrix.flavor }}.xcframework
154+
run: |
155+
tar -cz -f packages/react-native/third-party/ReactNativeDependencies${{ matrix.flavor }}.xcframework.tar.gz \
156+
packages/react-native/third-party/ReactNativeDependencies.xcframework
154157
- name: Show Symbol folder content
155158
if: steps.restore-xcframework.outputs.cache-hit != 'true'
156159
run: ls -lR packages/react-native/third-party/Symbols
157-
- name: Rename dSYM
160+
- name: Compress and Rename dSYM
158161
if: steps.restore-xcframework.outputs.cache-hit != 'true'
159162
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
163+
tar -cz -f packages/react-native/third-party/Symbols/ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz \
164+
packages/react-native/third-party/Symbols/ReactNativeDependencies.framework.dSYM
164165
- name: Upload XCFramework Artifact
165166
uses: actions/upload-artifact@v4
166167
with:
167168
name: ReactNativeDependencies${{ matrix.flavor }}.xcframework
168-
path: packages/react-native/third-party/ReactNativeDependencies${{ matrix.flavor }}.xcframework
169+
path: packages/react-native/third-party/ReactNativeDependencies${{ matrix.flavor }}.xcframework.tar.gz
169170
- name: Upload dSYM Artifact
170171
uses: actions/upload-artifact@v4
171172
with:
172173
name: ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM
173174
path: |
174-
packages/react-native/third-party/Symbols/ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM
175+
packages/react-native/third-party/Symbols/ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz
175176
- name: Save XCFramework in Cache
176177
if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode
177178
uses: actions/cache/save@v4
178179
with:
179-
path: packages/react-native/third-party/ReactNativeDependencies${{ matrix.flavor }}.xcframework
180-
key: v1-ios-dependencies-xcframework-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuilds/configuration.js') }}
180+
path: |
181+
packages/react-native/third-party/ReactNativeDependencies${{ matrix.flavor }}.xcframework.tar.gz
182+
packages/react-native/third-party/ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz
183+
key: v1-ios-dependencies-xcframework-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,37 +54,37 @@ val hermesDSYMReleaseArtifact: PublishArtifact =
5454
}
5555

5656
val reactNativeDependenciesDebugArtifactFile: RegularFile =
57-
layout.projectDirectory.file("artifacts/ReactNativeDependenciesDebug.xcframework")
57+
layout.projectDirectory.file("artifacts/ReactNativeDependenciesDebug.xcframework.tar.gz")
5858
val reactNativeDependenciesDebugArtifact: PublishArtifact =
5959
artifacts.add("externalArtifacts", reactNativeDependenciesDebugArtifactFile) {
60-
type = "xcframework"
61-
extension = "xcframework"
60+
type = "tgz"
61+
extension = "tar.gz"
6262
classifier = "reactnative-dependencies-debug"
6363
}
6464

6565
val reactNativeDependenciesReleaseArtifactFile: RegularFile =
66-
layout.projectDirectory.file("artifacts/ReactNativeDependenciesRelease.xcframework")
66+
layout.projectDirectory.file("artifacts/ReactNativeDependenciesRelease.xcframework.tar.gz")
6767
val reactNativeDependenciesReleaseArtifact: PublishArtifact =
6868
artifacts.add("externalArtifacts", reactNativeDependenciesReleaseArtifactFile) {
69-
type = "xcframework"
70-
extension = "xcframework"
69+
type = "tgz"
70+
extension = "tar.gz"
7171
classifier = "reactnative-dependencies-release"
7272
}
7373
val reactNativeDependenciesDebugDSYMArtifactFile: RegularFile =
74-
layout.projectDirectory.file("artifacts/ReactNativeDependenciesDebug.framework.dSYM")
74+
layout.projectDirectory.file("artifacts/ReactNativeDependenciesDebug.framework.dSYM.tar.gz")
7575
val reactNativeDependenciesDebugDSYMArtifact: PublishArtifact =
7676
artifacts.add("externalArtifacts", reactNativeDependenciesDebugArtifactFile) {
77-
type = "dSYM"
78-
extension = "dSYM"
77+
type = "tgz"
78+
extension = "tar.gz"
7979
classifier = "reactnative-dependencies-debug-dSYM"
8080
}
8181

8282
val reactNativeDependenciesReleaseDSYMArtifactFile: RegularFile =
83-
layout.projectDirectory.file("artifacts/ReactNativeDependenciesRelease.framework.dSYM")
83+
layout.projectDirectory.file("artifacts/ReactNativeDependenciesRelease.framework.dSYM.tar.gz")
8484
val reactNativeDependenciesReleaseDSYMArtifact: PublishArtifact =
8585
artifacts.add("externalArtifacts", reactNativeDependenciesReleaseArtifactFile) {
86-
type = "dSYM"
87-
extension = "dSYM"
86+
type = "tgz"
87+
extension = "tar.gz"
8888
classifier = "reactnative-dependencies-release-dSYM"
8989
}
9090

0 commit comments

Comments
 (0)