Skip to content

Commit a6f95b3

Browse files
committed
Configure building Android app for multiple architectures
1 parent 7711984 commit a6f95b3

File tree

2 files changed

+18
-15
lines changed

2 files changed

+18
-15
lines changed

.github/workflows/release-apk.yml

+2-15
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,6 @@ jobs:
1515
- name: Checkout
1616
uses: actions/checkout@v3
1717

18-
- name: Format ref
19-
id: format-ref
20-
shell: bash
21-
run: |
22-
sha_short="$(echo "${{ github.sha }}" | head -c 8)"
23-
ref="${sha_short}"
24-
25-
if ${{ startsWith(github.ref, 'refs/tags/') }}; then
26-
ref="${{ github.ref_name }}"
27-
fi
28-
29-
echo "::set-output name=value::${ref}"
30-
3118
- name: Restore Gradle cache
3219
uses: actions/cache@v3
3320
with:
@@ -50,8 +37,8 @@ jobs:
5037
popd
5138
5239
mv \
53-
"juicy-noise-android/app/build/outputs/apk/debug/app-debug.apk" \
54-
"juicy-noise-${{ steps.format-ref.outputs.value }}.apk"
40+
juicy-noise-android/app/build/outputs/apk/debug/*.apk \
41+
./
5542
5643
- name: Upload artifacts for Android
5744
uses: actions/upload-artifact@v3

juicy-noise-android/app/build.gradle

+16
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,22 @@ android {
4545
excludes += '/META-INF/{AL2.0,LGPL2.1}'
4646
}
4747
}
48+
49+
splits {
50+
abi {
51+
enable true
52+
reset()
53+
include 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
54+
universalApk true
55+
}
56+
}
57+
58+
applicationVariants.all { variant ->
59+
variant.outputs.all { output ->
60+
def applicationName = variant.applicationId.tokenize('.')[2]
61+
outputFileName = "${applicationName}-${variant.versionName}-${output.name}.apk"
62+
}
63+
}
4864
}
4965

5066
dependencies {

0 commit comments

Comments
 (0)