Skip to content

Commit 430102d

Browse files
authored
Merge pull request #3 from xianshenglu/dev
build: enableSeparateBuildPerCPUArchitecture
2 parents c3f857a + 45dcaa2 commit 430102d

4 files changed

Lines changed: 17 additions & 10 deletions

File tree

.github/workflows/android_build.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ name: Android Build ## name of the workflow
22

33
on:
44
push:
5+
pull_request:
56
branches:
6-
- '!main'
7+
- '!main'
78

89
jobs:
910
android-build:
@@ -41,7 +42,7 @@ jobs:
4142

4243
- name: Generate App APK
4344
run: |
44-
cd android && ./gradlew assembleRelease --no-daemon
45+
npm run build:release
4546
4647
## sign generated apk
4748
- name: Sign APK

.github/workflows/android_release.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Android Build ## name of the workflow
1+
name: Android Release ## name of the workflow
22

33
on:
44
push:
@@ -9,8 +9,8 @@ permissions:
99
contents: write
1010

1111
jobs:
12-
android-build:
13-
name: Android Build
12+
android-release:
13+
name: Android Release
1414
runs-on: ubuntu-latest # using ubuntu latest version / or you can use a specific version
1515

1616
steps:
@@ -44,7 +44,7 @@ jobs:
4444

4545
- name: Generate App APK
4646
run: |
47-
cd android && ./gradlew assembleRelease --no-daemon
47+
npm run build:release
4848
4949
## sign generated apk
5050
- name: Sign APK
@@ -74,7 +74,12 @@ jobs:
7474
uses: softprops/action-gh-release@v1
7575
with:
7676
tag_name: ${{steps.previous_tag.outputs.tag}}
77-
files: ${{steps.sign_app.outputs.signedReleaseFile}}
77+
files: |
78+
${{ steps.sign_app.signedReleaseFile0 }}
79+
${{ steps.sign_app.signedReleaseFile1 }}
80+
${{ steps.sign_app.signedReleaseFile2 }}
81+
${{ steps.sign_app.signedReleaseFile3 }}
82+
${{ steps.sign_app.signedReleaseFile4 }}
7883
7984

8085

android/app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@ apply from: new File(["node", "--print", "require.resolve('react-native/package.
9494
* Upload all the APKs to the Play Store and people will download
9595
* the correct one based on the CPU architecture of their device.
9696
*/
97-
def enableSeparateBuildPerCPUArchitecture = false
97+
def enableSeparateBuildPerCPUArchitecture = true
9898

9999
/**
100100
* Run Proguard to shrink the Java bytecode in release builds.
101101
*/
102-
def enableProguardInReleaseBuilds = false
102+
def enableProguardInReleaseBuilds = true
103103

104104
/**
105105
* The preferred build flavor of JavaScriptCore.
@@ -142,7 +142,7 @@ android {
142142
abi {
143143
reset()
144144
enable enableSeparateBuildPerCPUArchitecture
145-
universalApk false // If true, also generate a universal APK
145+
universalApk true // If true, also generate a universal APK
146146
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
147147
}
148148
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"eject": "expo eject",
1010
"test": "jest --watchAll",
1111
"build": "cd android && gradlew bundleRelease",
12+
"build:release": "cd android && ./gradlew assembleRelease --no-daemon",
1213
"install-on-device": "npx react-native run-android --variant=release",
1314
"changelog": "npx standard-version"
1415
},

0 commit comments

Comments
 (0)