Skip to content

Android build and release #2

Android build and release

Android build and release #2

Workflow file for this run

on:
push:
tags:
- "*"
name: Android build and release
jobs:
build:
name: Android build
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
steps:
- name: Cache Gradle files
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.22.2"
channel: "stable"
cache: true
- name: Cache pub dependencies
uses: actions/cache@v3
with:
path: |
${{ env.PUB_CACHE }}
.dart_tool
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }}
restore-keys: |
${{ runner.os }}-pub-
- uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "oracle"
- uses: actions/checkout@v4
with:
path: "app"
- uses: actions/checkout@v4
with:
repository: "hmziqrs/keys-n-stuff"
path: "app/.keys-n-stuff"
token: ${{ secrets.TOKEN }}
- name: Execute Keys n Stuff
run: |
cd app
dart ./scripts/keys-n-stuff.dart
- run: |
cd app
flutter pub get
dart scripts/version_sync.dart
flutter build apk -t lib/main.firebase.dart --release
flutter build appbundle -t lib/main.firebase.dart --release
- name: Create Android release
uses: ncipollo/release-action@v1
with:
artifacts: |
app/build/app/outputs/apk/release/app-release.apk
app/build/app/outputs/bundle/release/app-release.aab
token: ${{ secrets.TOKEN }}
allowUpdates: true
- uses: actions/upload-artifact@v4
with:
name: "app-release.aab"
path: "app/build/app/outputs/bundle/release/app-release.aab"
- uses: actions/upload-artifact@v4
with:
name: "app-release.apk"
path: "app/build/app/outputs/apk/release/app-release.apk"
release:
name: Android release
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
steps:
- uses: actions/checkout@v4
with:
repository: "hmziqrs/keys-n-stuff"
path: "keys"
token: ${{ secrets.TOKEN }}
- uses: actions/download-artifact@v4
with:
name: app-release.aab
path: artifacts
- run: ls -lah
- run: ls -lah keys/
- run: ls -lah keys/fuid
- run: ls -lah artifacts
- run: ls -lah artifacts/app-release.aab
- name: Upload app bundle to Google Play
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJson: "keys/fuid/service-account.json"
packageName: "com.onemdev.flutter_ui_challenges"
releaseFiles: "artifacts/*.aab"
track: "beta"
inAppUpdatePriority: 3
status: completed