image: ubuntu/jammy
packages:
  - openjdk-18-jdk
  - gradle
  - maven
sources:
  - https://git.sr.ht/~buzzert/KordophoneDroid
secrets: 
  - a24d65d9-3e71-40e9-946d-0e9b73efacee # ~/.gradle/gradle.properties: contains keystore passwords
  - 4fbe9d83-5f38-49c0-b93d-863d15e92a60 # ~/keystore.jks: Android keystore
tasks:
  - setup: |
      wget https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip
      unzip commandlinetools-linux-11076708_latest.zip
      mkdir android-sdk
      yes | ./cmdline-tools/bin/sdkmanager --sdk_root=android-sdk --licenses
      ./cmdline-tools/bin/sdkmanager --sdk_root=android-sdk "build-tools;34.0.0" "platforms;android-33"
  - build: |
      export ANDROID_HOME=~/android-sdk
      cd KordophoneDroid/
      ./gradlew assembleRelease
  - prepare: |
      cd KordophoneDroid/app/build/outputs/apk/release/
      cp app-arm64-v8a-release.apk    ~/kordophone-arm64-v8a-release.apk
      cp app-armeabi-v7a-release.apk  ~/kordophone-armeabi-v7a-release.apk
      cp app-x86_64-release.apk       ~/kordophone-x86_64-release.apk
      cp app-x86-release.apk          ~/kordophone-x86-release.apk
artifacts:
  - kordophone-arm64-v8a-release.apk
  - kordophone-armeabi-v7a-release.apk
  - kordophone-x86_64-release.apk
  - kordophone-x86-release.apk
