fdroiddata/templates/build-flutter.yml

65 lines
2.4 KiB
YAML
Raw Normal View History

2021-12-13 09:00:21 +00:00
# PLEASE REMOVE ALL COMMENTS BEFORE SUBMITTING TO F-DROID DATA!
# Starting from the following template and grep for "flutter" in the metadata
# directory to see other examples.
2024-05-08 13:51:45 +00:00
# Only choose one method between flutter submodule and srclib. If submodule method
# is chosen then please add flutter as a submodule in the source repo.
2021-12-13 09:00:21 +00:00
Builds:
- versionName: '1.0'
2023-01-01 12:09:30 +00:00
versionCode: 11
2021-12-13 09:00:21 +00:00
commit: v1.0
2022-12-03 05:08:16 +00:00
# Flutter should be added as a git submodule at e.g. .flutter
submodules: true
2023-01-01 12:09:30 +00:00
# This must be set else the build will fail.
# The output path can be found in the log.
2021-12-13 09:00:21 +00:00
output: build/app/outputs/flutter-apk/app-release.apk
# If you don't want to add a submodule, then you can add flutter as a srclib
# and checkout the required version manually
srclibs:
- flutter@stable
2021-12-13 09:00:21 +00:00
# Deletes unrelated directories,
# remove those not needed from the list.
rm:
- ios
- linux
- macos
- web
- windows
2022-12-03 05:08:16 +00:00
prebuild:
# Extract the flutter version and then checkout it in the flutter srclib
# Only needed when flutter srclib is used
2024-05-08 13:51:45 +00:00
- flutterVersion=$(sed -n -E "s/.*flutter-version:\ '(.*)'/\1/p" .github/workflows/release.yml)
- '[[ $flutterVersion ]] || exit 1'
- git -C $$flutter$$ checkout -f $flutterVersion
2022-12-03 05:08:16 +00:00
# Change pub cache location so that the dart packages are scanned by the scanner
- export PUB_CACHE=$(pwd)/.pub-cache
- .flutter/bin/flutter config --no-analytics
- .flutter/bin/flutter pub get
scanignore:
# Ignore a maven repo for Flutter engine for Flutter 3.12 or older
# - .flutter/packages/flutter_tools/gradle/flutter.gradle
2022-12-03 05:08:16 +00:00
# Ignore the downloaded dart tools
- .flutter/bin/cache
# Other binaries should be deleted
scandelete:
- .flutter
- .pub-cache
2021-12-13 09:00:21 +00:00
build:
2022-12-03 05:08:16 +00:00
# Make Flutter use the scanned cache
- export PUB_CACHE=$(pwd)/.pub-cache
2023-01-01 12:09:30 +00:00
# Split per abi to reduce the apk size.
# This is only for one abi. Please added other build blocks accordingly.
2022-12-03 05:08:16 +00:00
- .flutter/bin/flutter build apk --release --split-per-abi --target-platform="android-arm64"
2021-12-13 09:00:21 +00:00
AutoUpdateMode: Version
UpdateCheckMode: Tags
2022-12-03 05:08:16 +00:00
# This should be set according to the version code scheme
VercodeOperation:
- '%c * 10 + 1'
- '%c * 10 + 2'
- '%c * 10 + 3'
2021-12-13 09:00:21 +00:00
UpdateCheckData: pubspec.yaml|version:\s.+\+(\d+)|.|version:\s(.+)\+
CurrentVersion: '1.0'
2023-01-01 12:09:30 +00:00
CurrentVersionCode: 11