Build Signed APK #60
Workflow file for this run
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
name: Build Signed APK | |
on: | |
create: | |
tags: | |
- "*" | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
repository-projects: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set Up JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'adopt' | |
java-version: 17 | |
- name: Assemble Release | |
run: ./gradlew clean assembleRelease | |
- name: Sign Release | |
uses: r0adkll/sign-android-release@v1 | |
id: sign_release | |
with: | |
releaseDirectory: app/build/outputs/apk/release | |
signingKeyBase64: ${{ secrets.SIGNING_KEY }} | |
alias: ${{ secrets.ALIAS }} | |
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} | |
keyPassword: ${{ secrets.KEY_PASSWORD }} | |
env: | |
BUILD_TOOLS_VERSION: "34.0.0" | |
- name: Verify APK | |
run: ls -l app/build/outputs/apk/release/ | |
- name: Rename APK | |
run: mv ${{steps.sign_release.outputs.signedReleaseFile}} app/build/outputs/apk/release/${{ github.event.repository.name }}.apk | |
- name: Verify APK (2) | |
run: ls -l app/build/outputs/apk/release/ | |
- name: Create Release | |
id: create_release | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: '${{ github.ref_name}}' | |
release_name: '${{ github.ref_name}}' | |
draft: false | |
- name: Upload APK Universal Asset | |
id: upload-release-asset-universal-apk | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: '${{ steps.create_release.outputs.upload_url }}' | |
asset_path: app/build/outputs/apk/release/${{ github.event.repository.name }}.apk | |
asset_name: '${{ github.event.repository.name }}.apk' | |
asset_content_type: application/zip |