Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/apk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build test APK

# Manually-triggered build of the example app APK, uploaded as a downloadable
# artifact. Use this to get a test build without cutting a public release.
on:
workflow_dispatch:

permissions:
contents: read

jobs:
build-apk:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Set up Java 17
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '17'

- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.32.5'
channel: 'stable'
cache: true

- name: Read version
id: ver
run: echo "VERSION=$(grep '^version:' pubspec.yaml | cut -d ' ' -f 2 | cut -d '+' -f 1)" >> "$GITHUB_OUTPUT"

- name: Install example dependencies
run: flutter pub get
working-directory: example

- name: Build release APK
run: flutter build apk --release
working-directory: example
timeout-minutes: 20

- name: Rename APK with version
run: |
cd example/build/app/outputs/flutter-apk/
mv app-release.apk document_scanner_example_v${{ steps.ver.outputs.VERSION }}.apk
ls -la *.apk

- name: Upload APK artifact
uses: actions/upload-artifact@v4
with:
name: document_scanner_example_v${{ steps.ver.outputs.VERSION }}-apk
path: example/build/app/outputs/flutter-apk/document_scanner_example_v${{ steps.ver.outputs.VERSION }}.apk
if-no-files-found: error
retention-days: 30
Loading