Skip to content

Commit

Permalink
ci: build and publish App Bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
kyujin-cho committed Jan 20, 2024
1 parent 41c4f00 commit b3d1c87
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 2 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/build-aab.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
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 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_apk.outputs.upload_filename }}
path: dev.bluehouse.enablevolte.aab
retention-days: 3
19 changes: 17 additions & 2 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,16 @@ jobs:
key-alias: ${{ secrets.KEY_ALIAS }}
keystore: ${{ secrets.KEYSTORE_B64 }}
key-password: ${{ secrets.KEY_PASSWORD }}
build-app-bundle:
needs: [lint]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
uses: ./.github/workflows/build-aab.yml
secrets:
key-alias: ${{ secrets.KEY_ALIAS }}
keystore: ${{ secrets.KEYSTORE_B64 }}
key-password: ${{ secrets.KEY_PASSWORD }}
release:
needs: [build-release-apk]
needs: [build-release-apk, build-app-bundle]
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -68,9 +76,16 @@ jobs:
uses: actions/download-artifact@v3
with:
name: ${{ needs.build-release-apk.outputs.filename }}
- name: Download App Bundle
id: download
uses: actions/download-artifact@v3
with:
name: ${{ needs.build-app-bundle.outputs.filename }}
- name: Release to GitHub
uses: softprops/action-gh-release@v1
with:
name: "v${{ github.ref_name }}"
generate_release_notes: true
files: dev.bluehouse.enablevolte.apk
files: |
dev.bluehouse.enablevolte.apk
dev.bluehouse.enablevolte.aab

0 comments on commit b3d1c87

Please sign in to comment.