Files
OnBudget/.gitea/workflows/build-apk.yml
T
2026-08-11 23:39:31 +03:00

64 lines
1.7 KiB
YAML

name: build-apk
on:
push:
branches: [master]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
container:
image: ghcr.io/cirruslabs/flutter:3.38.10
steps:
# The cirruslabs/flutter image has no Node.js; actions/checkout and
# actions/upload-artifact are JS actions that need `node` inside the job container.
- name: Install Node.js
run: |
set -eux
NODE_TGZ=$(curl -fsSL https://nodejs.org/dist/latest-v22.x/ | grep -oE 'node-v22\.[0-9]+\.[0-9]+-linux-x64\.tar\.xz' | sort -V | tail -1)
curl -fsSL "https://nodejs.org/dist/latest-v22.x/${NODE_TGZ}" -o /tmp/node.tar.xz
tar -xJf /tmp/node.tar.xz -C /usr/local --strip-components=1
node --version
- name: Checkout
uses: actions/checkout@v4
- name: Cache pub deps
uses: actions/cache@v4
with:
path: |
${{ env.FLUTTER_ROOT }}/.pub-cache
.dart_tool
key: pub-${{ hashFiles('pubspec.lock') }}
- name: Cache Gradle
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: gradle-${{ hashFiles('android/**/*.gradle*') }}
- name: Pub get
run: flutter pub get
- name: Codegen (build_runner)
run: dart run build_runner build --delete-conflicting-outputs
- name: Generate l10n
run: flutter gen-l10n
- name: Analyze
run: flutter analyze
- name: Test
run: flutter test
- name: Build debug APK
run: flutter build apk --debug
- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: onbudget-debug-apk
path: build/app/outputs/flutter-apk/app-debug.apk