build(metro): add web shims for native React Native API compatibility
Add Metro configuration to resolve native-only React Native APIs with web-compatible shims. This enables packages like react-native-pager-view to work on the web platform by providing shim implementations for codegenNativeComponent, codegenNativeCommands, and CodegenTypes that are unavailable in react-native-web. Also simplify Android signing configuration in CI by using standard Gradle property names (MYAPP_UPLOAD_*) and remove the build.gradle patching step.
This commit is contained in:
@@ -154,29 +154,6 @@ jobs:
|
||||
run: |
|
||||
echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 -d > android/app/withyou-release-key.keystore
|
||||
|
||||
- name: Patch app/build.gradle with signing config
|
||||
run: |
|
||||
cd android/app
|
||||
python3 -c "
|
||||
import re
|
||||
with open('build.gradle', 'r') as f:
|
||||
content = f.read()
|
||||
release_signing = '''
|
||||
signingConfigs {
|
||||
release {
|
||||
storeFile file(WITHYOU_UPLOAD_STORE_FILE)
|
||||
storePassword WITHYOU_UPLOAD_STORE_PASSWORD
|
||||
keyAlias WITHYOU_UPLOAD_KEY_ALIAS
|
||||
keyPassword WITHYOU_UPLOAD_KEY_PASSWORD
|
||||
}
|
||||
}
|
||||
'''
|
||||
content = content.replace('signingConfigs {}', release_signing)
|
||||
content = content.replace('signingConfig signingConfigs.debug', 'signingConfig signingConfigs.release')
|
||||
with open('build.gradle', 'w') as f:
|
||||
f.write(content)
|
||||
"
|
||||
|
||||
- name: Configure Gradle with Aliyun Maven mirror
|
||||
run: |
|
||||
cd android
|
||||
@@ -291,10 +268,10 @@ jobs:
|
||||
run: |
|
||||
cd android
|
||||
cat >> gradle.properties << SIGNING_PROPS
|
||||
WITHYOU_UPLOAD_STORE_FILE=withyou-release-key.keystore
|
||||
WITHYOU_UPLOAD_STORE_PASSWORD=${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
|
||||
WITHYOU_UPLOAD_KEY_ALIAS=withyou-key
|
||||
WITHYOU_UPLOAD_KEY_PASSWORD=${{ secrets.ANDROID_KEY_PASSWORD }}
|
||||
MYAPP_UPLOAD_STORE_FILE=withyou-release-key.keystore
|
||||
MYAPP_UPLOAD_STORE_PASSWORD=${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
|
||||
MYAPP_UPLOAD_KEY_ALIAS=withyou-key
|
||||
MYAPP_UPLOAD_KEY_PASSWORD=${{ secrets.ANDROID_KEY_PASSWORD }}
|
||||
SIGNING_PROPS
|
||||
|
||||
- name: Build Android release APK (arm64 only)
|
||||
|
||||
Reference in New Issue
Block a user