Skip to content

Commit

Permalink
Configure building Android app for multiple architectures
Browse files Browse the repository at this point in the history
  • Loading branch information
Danand committed Mar 29, 2024
1 parent 7711984 commit a6f95b3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
17 changes: 2 additions & 15 deletions .github/workflows/release-apk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Format ref
id: format-ref
shell: bash
run: |
sha_short="$(echo "${{ github.sha }}" | head -c 8)"
ref="${sha_short}"
if ${{ startsWith(github.ref, 'refs/tags/') }}; then
ref="${{ github.ref_name }}"
fi
echo "::set-output name=value::${ref}"
- name: Restore Gradle cache
uses: actions/cache@v3
with:
Expand All @@ -50,8 +37,8 @@ jobs:
popd
mv \
"juicy-noise-android/app/build/outputs/apk/debug/app-debug.apk" \
"juicy-noise-${{ steps.format-ref.outputs.value }}.apk"
juicy-noise-android/app/build/outputs/apk/debug/*.apk \
./
- name: Upload artifacts for Android
uses: actions/upload-artifact@v3
Expand Down
16 changes: 16 additions & 0 deletions juicy-noise-android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,22 @@ android {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
}
}

splits {
abi {
enable true
reset()
include 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
universalApk true
}
}

applicationVariants.all { variant ->
variant.outputs.all { output ->
def applicationName = variant.applicationId.tokenize('.')[2]
outputFileName = "${applicationName}-${variant.versionName}-${output.name}.apk"
}
}
}

dependencies {
Expand Down

0 comments on commit a6f95b3

Please sign in to comment.