Skip to content

Build release apk and app bundle #22

Build release apk and app bundle

Build release apk and app bundle #22

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: Build Release
# Controls when the workflow will run
on: workflow_dispatch
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Retrieve the secret and decode it to a file
env:
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
KEYSTORE_PASS: ${{ secrets.KEYSTORE_PASS }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASS: ${{ secrets.KEY_PASS }}
run: |
echo $KEYSTORE_BASE64 | base64 --decode > extinguish.jks
ls
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'corretto' # See 'Supported distributions' for available options
java-version: '17'
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build Project
run: |
./gradlew assembleRelease
- name: Signing
env:
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
KEYSTORE_PASS: ${{ secrets.KEYSTORE_PASS }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASS: ${{ secrets.KEY_PASS }}
run: |
apk_path="./app/build/outputs/apk/release"
build_tools_path="$ANDROID_SDK_ROOT/build-tools/35.0.0"
$build_tools_path/zipalign -v -p 4 "$apk_path/app-release.apk" "$apk_path/app-release-aligned.apk"
$build_tools_path/apksigner sign --ks "./extinguish.jks" --ks-key-alias $KEY_ALIAS --ks-pass pass:$KEYSTORE_PASS --key-pass pass:$KEY_PASS --out "$apk_path/app-release.apk" "$apk_path/app-release-aligned.apk"
$build_tools_path/apksigner verify -v "$apk_path/app-release.apk"
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: app-release
path: app/build/outputs/apk/release/app-release.apk