ci(build): add Tencent Gradle mirror and reorder Maven mirrors for China network
- Add new step to switch Gradle distribution URL to Tencent mirror (mirrors.cloud.tencent.com/gradle/) - Reorder Maven repository configuration to prioritize Aliyun mirrors before google() and mavenCentral() - Add gradle-plugin to Aliyun mirror list for improved China network compatibility
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
name: Frontend CI
|
name: Frontend CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -150,25 +150,37 @@ jobs:
|
|||||||
- name: Generate Android native project
|
- name: Generate Android native project
|
||||||
run: npx expo prebuild --platform android
|
run: npx expo prebuild --platform android
|
||||||
|
|
||||||
|
- name: Switch Gradle distribution to Tencent mirror
|
||||||
|
run: |
|
||||||
|
PROPS="android/gradle/wrapper/gradle-wrapper.properties"
|
||||||
|
if [ -f "$PROPS" ]; then
|
||||||
|
sed -i 's|distributionUrl=https\\://services.gradle.org/distributions/|distributionUrl=https\\://mirrors.cloud.tencent.com/gradle/|' "$PROPS"
|
||||||
|
echo "Updated gradle-wrapper.properties:"
|
||||||
|
cat "$PROPS"
|
||||||
|
else
|
||||||
|
echo "gradle-wrapper.properties not found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Decode Android signing keystore
|
- name: Decode Android signing keystore
|
||||||
run: |
|
run: |
|
||||||
echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 -d > android/app/withyou-release-key.keystore
|
echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 -d > android/app/withyou-release-key.keystore
|
||||||
|
|
||||||
- name: Configure Gradle with Aliyun Maven mirror
|
- name: Configure Gradle with China Maven mirrors
|
||||||
run: |
|
run: |
|
||||||
cd android
|
cd android
|
||||||
|
|
||||||
# Update settings.gradle with Aliyun Maven mirror
|
# Update settings.gradle with China Maven mirrors
|
||||||
cat > settings.gradle << 'SETTINGS_EOF'
|
cat > settings.gradle << 'SETTINGS_EOF'
|
||||||
pluginManagement {
|
pluginManagement {
|
||||||
repositories {
|
repositories {
|
||||||
|
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
|
||||||
|
maven { url 'https://maven.aliyun.com/repository/google' }
|
||||||
|
maven { url 'https://maven.aliyun.com/repository/public' }
|
||||||
|
maven { url 'https://maven.aliyun.com/repository/central' }
|
||||||
google()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
maven { url 'https://maven.aliyun.com/repository/public' }
|
|
||||||
maven { url 'https://maven.aliyun.com/repository/google' }
|
|
||||||
maven { url 'https://maven.aliyun.com/repository/central' }
|
|
||||||
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
|
|
||||||
}
|
}
|
||||||
def reactNativeGradlePlugin = new File(
|
def reactNativeGradlePlugin = new File(
|
||||||
providers.exec {
|
providers.exec {
|
||||||
@@ -210,18 +222,18 @@ jobs:
|
|||||||
includeBuild(expoAutolinking.reactNativeGradlePlugin)
|
includeBuild(expoAutolinking.reactNativeGradlePlugin)
|
||||||
SETTINGS_EOF
|
SETTINGS_EOF
|
||||||
|
|
||||||
# Update build.gradle with Aliyun Maven mirror
|
# Update build.gradle with China Maven mirrors
|
||||||
cat > build.gradle << 'BUILD_EOF'
|
cat > build.gradle << 'BUILD_EOF'
|
||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
|
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
|
||||||
|
maven { url 'https://maven.aliyun.com/repository/google' }
|
||||||
|
maven { url 'https://maven.aliyun.com/repository/public' }
|
||||||
|
maven { url 'https://maven.aliyun.com/repository/central' }
|
||||||
google()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven { url 'https://maven.aliyun.com/repository/public' }
|
|
||||||
maven { url 'https://maven.aliyun.com/repository/google' }
|
|
||||||
maven { url 'https://maven.aliyun.com/repository/central' }
|
|
||||||
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
|
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath('com.android.tools.build:gradle')
|
classpath('com.android.tools.build:gradle')
|
||||||
@@ -232,12 +244,12 @@ jobs:
|
|||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
|
maven { url 'https://maven.aliyun.com/repository/google' }
|
||||||
|
maven { url 'https://maven.aliyun.com/repository/public' }
|
||||||
|
maven { url 'https://maven.aliyun.com/repository/central' }
|
||||||
|
maven { url 'https://www.jitpack.io' }
|
||||||
google()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven { url 'https://www.jitpack.io' }
|
|
||||||
maven { url 'https://maven.aliyun.com/repository/public' }
|
|
||||||
maven { url 'https://maven.aliyun.com/repository/google' }
|
|
||||||
maven { url 'https://maven.aliyun.com/repository/central' }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user