Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Build & Release

Build & Release #20

Workflow file for this run

name: Build & Release
permissions:
contents: write
on:
workflow_dispatch:
push:
tags:
- 'v*'
jobs:
build:
name: Build Release APKs
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Checkout reproducible-apk-tools
uses: actions/checkout@v4
with:
repository: obfusk/reproducible-apk-tools
ref: v0.3.0
path: reproducible-apk-tools
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version-file: .flutter-version
cache: true
- name: Flutter Doctor
id: flutter_doctor
run: |
flutter doctor -v
- name: Get Dependencies
run: flutter pub get
# --- SIGNING SETUP ---
- name: Decode Keystore
run: |
echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 --decode > android/app/upload-keystore.jks
- name: Create key.properties
run: |
echo "storePassword=${{ secrets.ANDROID_STORE_PASSWORD }}" > android/key.properties
echo "keyPassword=${{ secrets.ANDROID_KEY_PASSWORD }}" >> android/key.properties
echo "keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}" >> android/key.properties
echo "storeFile=upload-keystore.jks" >> android/key.properties
# --- BUILD APKs ---
- name: Build Split APKs
run: flutter build apk --release --split-per-abi
- name: Zipalign APKs
run: |
cd build/app/outputs/apk/release
for apk in *.apk; do
mv "$apk" "${apk%.apk}-unaligned.apk"
python3 ${{ github.workspace }}/reproducible-apk-tools/zipalign.py \
--page-size 16 \
--pad-like-apksigner \
--replace \
"${apk%.apk}-unaligned.apk" \
"$apk"
rm "${apk%.apk}-unaligned.apk"
done
# --- PUBLISH ---
- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: "build/app/outputs/apk/release/*.apk"
token: ${{ secrets.GITHUB_TOKEN }}
generateReleaseNotes: true