arch: null artifacts: - goguma/build/app/outputs/flutter-apk/app-release.apk environment: BUILD_SUBMITTER: git.sr.ht GIT_REF: refs/heads/master image: archlinux packages: - android-sdk - android-sdk-build-tools - android-sdk-cmdline-tools-latest - android-sdk-platform-tools - jdk17-openjdk - unzip repositories: {} secrets: - 77c7956b-003e-44f7-bb5c-2944b2047654 - 6d21b97d-cd64-4490-b325-acf8b05a542f - 431b0b53-2af2-441b-b879-86c5913bab4d - 4e454305-057f-44c3-9a4e-eeb74d54545b - a76ea4e0-b264-4b32-b701-7cadf78b3230 shell: false sources: - https://git.sr.ht/~emersion/goguma#b6dc14cd6c1862caac9cf677fb011f7507cbfb54 tasks: - flutter: | git clone --depth=1 --branch=stable https://github.com/flutter/flutter.git export PATH="$PATH:$PWD/flutter/bin" echo "PATH=$PATH" >>~/.buildenv flutter precache --android # need write permission or else licenses are never accepted sudo chown -R $USER /opt/android-sdk yes | flutter doctor --android-licenses >/dev/null flutter doctor -v - configure: | cd goguma ln -s ~/keystore.properties android/keystore.properties ln -s ~/keystore.jks android/keystore.jks flutter pub get dart run tool/gen_main.dart --firebase ~/google-services.json lib/main_generated.dart - build: | cd goguma tag="$(git describe --abbrev=0)" hash="$(git rev-parse --short=12 HEAD)" build_name="${tag#v}-dev+$hash.firebase" build_number="$(git rev-list --first-parent --count origin/master)" sentry_dsn="$(cat ~/sentry-dsn.txt)" flutter build apk \ --build-name="$build_name" \ --build-number="$build_number" \ --target=lib/main_generated.dart \ --dart-define=SENTRY_DSN="$sentry_dsn" \ --dart-define=SENTRY_ENVIRONMENT="nightly" \ --dart-define=SENTRY_RELEASE="$build_name" - analyze: | cd goguma flutter analyze --no-fatal-infos - deploy: | cd goguma [ "$(git rev-parse origin/master)" = "$(git rev-parse HEAD)" ] || complete-build build_number="$(git rev-list --first-parent --count origin/master)" ssh_opts="-o StrictHostKeyChecking=no" ssh_host="deploy@sheeta.emersion.fr" scp $ssh_opts build/app/outputs/flutter-apk/app-release.apk "$ssh_host":fdroid-goguma-nightly/repo/goguma-"$build_number".apk ssh $ssh_opts "$ssh_host" "cd fdroid-goguma-nightly && (ls -t repo/*.apk | tail -n +5 | xargs -r rm --) && fdroid update" triggers: [] oauth: ""