Skip to content

changes

changes #3

name: Develop APK build
on:
push:
branches: [ "develop" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Java 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: 3.24.2
- name: Install dependencies
run: flutter pub get
- name: Decode keystore
run: echo $KEY_STORE | base64 --decode > $GITHUB_WORKSPACE/release-key.jks
env:
KEY_STORE: ${{ secrets.KEY_STORE }}
- name: Build APK
run: flutter build apk --release --dart-define=config.server.network.host=${{ vars.SERVER_HOST }} --dart-define=config.server.network.port=${{ vars.SERVER_PORT }}
- name: Sign APK
run: |
jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 -keystore $GITHUB_WORKSPACE/release-key.jks -storepass $KEY_STORE_PASSWORD -keypass $KEY_PASSWORD build/app/outputs/flutter-apk/app-release.apk $KEY_ALIAS
env:
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
- name: Align APK
run: zipalign -v 4 build/app/outputs/flutter-apk/app-release.apk build/app/outputs/flutter-apk/app-release.apk
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/app/outputs/flutter-apk/app-release.apk
asset_name: app-release.apk
tag: develop
overwrite: true