1
0
Fork 0
mirror of https://gitlab.com/futo-org/fcast.git synced 2025-08-10 03:02:48 +00:00
fcast/receivers/android/.gitlab-ci.yml
2023-06-20 16:39:58 +02:00

40 lines
1.8 KiB
YAML

stages:
- buildAndDeployApk
- buildAndDeployPlayStoreAab
variables:
ANDROID_VERSION_NAME:
value: ""
description: "Enter the version name here (e.g. 1.0.1)."
ANDROID_VERSION_CODE:
value: ""
description: "Enter the version code here (e.g. 1)."
buildAndDeployApk:
stage: buildAndDeployApk
before_script:
- cd receivers/android
script:
- if [ -z "$ANDROID_VERSION_NAME" ] || [ -z "$ANDROID_VERSION_CODE" ]; then echo "Version name or code not specified. Skipping build."; exit 0; fi
- ./gradlew --stacktrace assembleRelease -PversionName=$ANDROID_VERSION_NAME -PversionCode=$ANDROID_VERSION_CODE
- cp ./app/build/outputs/apk/release/app-release.apk /var/www/html/fcast-release.apk
- cp ./app/build/outputs/apk/release/app-release.apk /var/www/html/fastcast-release.apk
- echo $ANDROID_VERSION_CODE > /var/www/html/fastcast-version.txt
- echo $ANDROID_VERSION_CODE > /var/www/html/fcast-version.txt
when: manual
buildAndDeployPlayStoreAab:
stage: buildAndDeployPlayStoreAab
before_script:
- cd receivers/android
script:
- if [ -z "$ANDROID_VERSION_NAME" ] || [ -z "$ANDROID_VERSION_CODE" ]; then echo "Version name or code not specified. Skipping build."; exit 0; fi
- ./gradlew --stacktrace assemblePlaystoreRelease -PversionName=$ANDROID_VERSION_NAME -PversionCode=$ANDROID_VERSION_CODE
- ls -la ./app/build/outputs/
- ls -la ./app/build/outputs/aab/playstoreRelease
- ls -la ./app/build/outputs/aab/release
- cp ./app/build/outputs/apk/release/app-release.apk /var/www/html/fcast-release.apk
- cp ./app/build/outputs/apk/release/app-release.apk /var/www/html/fastcast-release.apk
- echo $ANDROID_VERSION_CODE > /var/www/html/fastcast-version.txt
- echo $ANDROID_VERSION_CODE > /var/www/html/fcast-version.txt
when: manual