-
-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: build and publish App Bundle (#235)
- Loading branch information
1 parent
41c4f00
commit 21f783b
Showing
2 changed files
with
80 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
on: | ||
workflow_call: | ||
outputs: | ||
filename: | ||
description: "artifact file name" | ||
value: ${{ jobs.build-apk.outputs.filename }} | ||
secrets: | ||
key-alias: | ||
required: false | ||
keystore: | ||
required: false | ||
key-password: | ||
required: false | ||
|
||
jobs: | ||
build-aab: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
filename: ${{ steps.build_aab.outputs.upload_filename }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up OpenJDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: "zulu" | ||
java-version: "17" | ||
- name: Setup Android SDK | ||
uses: android-actions/setup-android@v2 | ||
- name: Install required platform | ||
run: sdkmanager "platforms;android-33" "build-tools;33.0.2" | ||
- name: Replace android.jar | ||
run: | | ||
curl -L https://github.com/Reginer/aosp-android-jar/raw/main/android-33/android.jar > /usr/local/lib/android/sdk/platforms/android-33/android.jar | ||
- name: Build App Bundle | ||
id: build_aab | ||
run: | | ||
./gradlew bundleRelease | ||
echo "upload_filename=${RUN_ID}-AAB" >> $GITHUB_OUTPUT | ||
env: | ||
RUN_ID: ${{ github.run_id }} | ||
- name: Save keystore as file | ||
run: echo "${KEYSTORE_B64}" | base64 -d > keystore.jks | ||
env: | ||
KEYSTORE_B64: ${{ secrets.keystore }} | ||
- name: Sign APK | ||
run: | | ||
echo "${KEY_PASSWORD}" | \ | ||
$ANDROID_SDK_ROOT/build-tools/33.0.2/apksigner sign \ | ||
--ks keystore.jks --ks-key-alias "${KEY_ALIAS}" \ | ||
--key-pass "env:KEY_PASSWORD" \ | ||
--out dev.bluehouse.enablevolte.aab \ | ||
--min-sdk-version $(cat app/build.gradle | grep minSdk | awk '{print $2}') \ | ||
app/build/outputs/bundle/release/app-release.aab | ||
env: | ||
KEY_ALIAS: ${{ secrets.key-alias }} | ||
KEY_PASSWORD: ${{ secrets.key-password }} | ||
- name: Upload APK | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ steps.build_aab.outputs.upload_filename }} | ||
path: dev.bluehouse.enablevolte.aab | ||
retention-days: 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters