Skip to content

Commit

Permalink
Add AAB publishing (required for Android TV)
Browse files Browse the repository at this point in the history
  • Loading branch information
pimterry committed Nov 19, 2024
1 parent c9a1ed4 commit a4c9b23
Showing 1 changed file with 31 additions and 7 deletions.
38 changes: 31 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,24 @@ jobs:
- name: Setup Android SDK
uses: android-actions/setup-android@v2

- name: Build release
- name: Build release APK
run: ./gradlew assembleRelease

- name: Build release AAB
run: ./gradlew bundleRelease

- uses: actions/upload-artifact@v4
with:
name: unsigned-app.apk
path: app/build/outputs/apk/release/app-release-unsigned.apk
if-no-files-found: error

- uses: actions/upload-artifact@v4
with:
name: unsigned-app.aab
path: app/build/outputs/bundle/release/app-release.aab
if-no-files-found: error

deploy:
name: Deploy to GitHub Releases
needs: build
Expand All @@ -37,14 +46,21 @@ jobs:
name: unsigned-app.apk
path: .


- name: Get the AAB
uses: actions/download-artifact@v4
with:
name: unsigned-app.aab
path: .

- name: Detect latest build tool version
shell: bash
run: |
BUILD_TOOL_VERSION=$(ls /usr/local/lib/android/sdk/build-tools/ | tail -n 1)
echo "BUILD_TOOL_VERSION=$BUILD_TOOL_VERSION" >> $GITHUB_ENV
echo Latest build tool version is: $BUILD_TOOL_VERSION
- name: Sign the APK
- name: Sign the APK & AAB
uses: r0adkll/sign-android-release@v1
id: sign_app
with:
Expand All @@ -56,19 +72,27 @@ jobs:
env:
BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }}

- name: Publish the APK to GitHub Releases
- name: List release files
run: ls -l

- name: Rename release files
run: |
mv ./app-release-unsigned-signed.apk ./httptoolkit.apk
mv ./app-release.aab ./httptoolkit.aab
- name: Publish the APK & AAB to GitHub Releases
uses: svenstaro/upload-release-action@v2
with:
prerelease: true
asset_name: httptoolkit.apk
file: ${{ steps.sign_app.outputs.signedReleaseFile }}
file: ./httptoolkit{.apk,.aab}
file_glob: true
tag: ${{ github.ref }}
repo_token: ${{ secrets.GITHUB_TOKEN }}

- name: Publish the APK to Google Play
- name: Publish the AAB to Google Play
uses: r0adkll/[email protected]
with:
serviceAccountJsonPlainText: ${{ secrets.PLAY_SERVICE_ACCOUNT_JSON }}
packageName: tech.httptoolkit.android.v1
releaseFiles: ${{ steps.sign_app.outputs.signedReleaseFile }}
releaseFiles: ./httptoolkit.aab
track: production

0 comments on commit a4c9b23

Please sign in to comment.