Skip to content

Workflow file for this run

name: πŸ“¦πŸš€ Build & deploy Android app for an environment
on:
release:
types:
- published
jobs:
deployAndroid:
permissions: write-all
name: πŸ€–πŸ“¦πŸš€ Build & deploy Android release
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repository
uses: actions/checkout@v3
- name: βš™οΈ Setup Java
uses: actions/setup-java@v3
with:
java-version: "19.x"
cache: 'gradle'
distribution: 'adopt'
id: java
- name: βš™οΈ Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.13.6"
channel: 'stable'
cache: true
id: flutter
- name: πŸ” Retrieve base64 keystore and decode it to a file
id: write_file
uses: timheuer/[email protected]
with:
fileName: "android-keystore.jks"
fileDir: "${{ github.workspace }}/"
encodedString: ${{ secrets.KEYSTORE_FILE_BASE64 }}
- name: πŸ“πŸ” Create keystore.properties file
env:
KEYSTORE_PROPERTIES_PATH: ${{ github.workspace }}/android/key.properties
run: |
echo "storeFile=${{ github.workspace }}/android-keystore.jks" > $KEYSTORE_PROPERTIES_PATH
echo "keyAlias=${{ secrets.KEYSTORE_KEY_ALIAS }}" >> $KEYSTORE_PROPERTIES_PATH
echo "storePassword=${{ secrets.KEYSTORE_PASSWORD }}" >> $KEYSTORE_PROPERTIES_PATH
echo "keyPassword=${{ secrets.KEYSTORE_KEY_PASSWORD }}" >> $KEYSTORE_PROPERTIES_PATH
- uses: olegtarasov/get-tag@v2 # that generate $GIT_TAG_NAME env
id: tagName
with:
tagRegex: 'internal-v([0-9]+.[0-9]+.[0-9]+\+[0-9]+)' # Optional. Returns specified group text as tag name. Full tag string is returned if regex is not defined.
tagRegexGroup: 1 # Optional. Default is 1.
- name: Replace YAML version with tag version
run: |
sed -i 's/99.99.99+99/'$GIT_TAG_NAME'/g' pubspec.yaml|
echo "Tag used version:"$GIT_TAG_NAME
- name: Pub Get Packages
run: flutter pub get
- name: πŸ€–πŸ“¦ Create Android release
run: |
flutter build appbundle --release
flutter build apk --split-per-abi --release
- name: πŸ€–πŸš€ Upload to GitHub release
uses: AButler/[email protected]
with:
files: 'build/app/outputs/flutter-apk/*;build/app/outputs/bundle/release/*'
repo-token: ${{ secrets.GITHUB_TOKEN }}