Skip to content

Commit 5318562

Browse files
committed
fix: Add APK alignment step with latest build-tools to CI and release workflows
1 parent 8b9e214 commit 5318562

2 files changed

Lines changed: 20 additions & 20 deletions

File tree

.github/workflows/android-build.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@ jobs:
3838
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
3939
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
4040

41+
- name: Align APK with latest build-tools
42+
run: |
43+
# Find latest build-tools version
44+
BUILD_TOOLS_VERSION=$(ls -1 ${ANDROID_HOME}/build-tools | sort -V | tail -n 1)
45+
echo "Using build-tools version: $BUILD_TOOLS_VERSION"
46+
47+
${ANDROID_HOME}/build-tools/${BUILD_TOOLS_VERSION}/zipalign -v 4 \
48+
app/build/outputs/apk/release/app-release-unsigned.apk \
49+
app/build/outputs/apk/release/app-release.apk
50+
4151
- name: Sign Release APK (if keystore exists)
4252
id: sign_app
4353
uses: ilharp/sign-android-release@v1.0.4
@@ -48,16 +58,6 @@ jobs:
4858
keyAlias: ${{ secrets.ANDROID_KEY_ALIAS }}
4959
keyStorePassword: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
5060
keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }}
51-
52-
- name: Align APK with latest build-tools
53-
run: |
54-
# Find latest build-tools version
55-
BUILD_TOOLS_VERSION=$(ls -1 ${ANDROID_HOME}/build-tools | sort -V | tail -n 1)
56-
echo "Using build-tools version: $BUILD_TOOLS_VERSION"
57-
58-
${ANDROID_HOME}/build-tools/${BUILD_TOOLS_VERSION}/zipalign -v 4 \
59-
app/build/outputs/apk/release/app-release-unsigned.apk \
60-
app/build/outputs/apk/release/app-release.apk
6161

6262
- name: Get commit info
6363
id: commit_info

.github/workflows/release.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ jobs:
5050
- name: Build Debug APK
5151
run: ./gradlew assembleDebug
5252

53+
- name: Align APK with latest build-tools
54+
run: |
55+
# Find latest build-tools version
56+
BUILD_TOOLS_VERSION=$(ls -1 ${ANDROID_HOME}/build-tools | sort -V | tail -n 1)
57+
echo "Using build-tools version: $BUILD_TOOLS_VERSION"
58+
59+
${ANDROID_HOME}/build-tools/${BUILD_TOOLS_VERSION}/zipalign -v 4 \
60+
app/build/outputs/apk/release/app-release-unsigned.apk \
61+
app/build/outputs/apk/release/app-release.apk
62+
5363
- name: Sign Release APK (if keystore exists)
5464
id: sign_app
5565
uses: ilharp/sign-android-release@v1.0.4
@@ -60,16 +70,6 @@ jobs:
6070
keyAlias: ${{ secrets.ANDROID_KEY_ALIAS }}
6171
keyStorePassword: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
6272
keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }}
63-
64-
- name: Align APK with latest build-tools
65-
run: |
66-
# Find latest build-tools version
67-
BUILD_TOOLS_VERSION=$(ls -1 ${ANDROID_HOME}/build-tools | sort -V | tail -n 1)
68-
echo "Using build-tools version: $BUILD_TOOLS_VERSION"
69-
70-
${ANDROID_HOME}/build-tools/${BUILD_TOOLS_VERSION}/zipalign -v 4 \
71-
app/build/outputs/apk/release/app-release-unsigned.apk \
72-
app/build/outputs/apk/release/app-release.apk
7373

7474
- name: Get build info
7575
id: build_info

0 commit comments

Comments
 (0)