Skip to content

Instantly share code, notes, and snippets.

@kmartins
Forked from vinicioslc/flutter-android-cd.yml
Created October 15, 2021 01:29
Show Gist options
  • Save kmartins/261ece0482109f37eff28e0f3c841563 to your computer and use it in GitHub Desktop.
Save kmartins/261ece0482109f37eff28e0f3c841563 to your computer and use it in GitHub Desktop.
Build flutter releases in github actions for production only android for while.
# This is a basic workflow to help you get started with Actions
name: CD
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
tags:
- "v*.*.*" # on every version tag will build a new android artifact.
jobs:
build:
name: Build APK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: "12.x"
- name: Setup Flutter
uses: subosito/flutter-action@v1
with:
flutter-version: "1.17.5"
- name: Decoding android/key.properties
run: echo "${{ secrets.KEYPROP_PROD }}" | base64 --decode > android/key.properties
- name: Decoding android/neumodore_key.jks
run: echo "${{ secrets.KEYJKS_PROD }}" | base64 --decode > android/key.jks
- name: Pub Get Packages
run: flutter pub get
- name: Build APK
run: flutter build apk --split-per-abi --release
- name: Build APPBUNDLE
run: flutter build appbundle --release
- name: Create Github Release
uses: ncipollo/release-action@v1
with:
artifacts: "build/app/outputs/apk/release/*.apk,build/app/outputs/bundle/release/*.aab"
token: ${{ secrets.RELEASES_TOKEN }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment