57 lines
2.3 KiB
YAML
57 lines
2.3 KiB
YAML
stages:
|
|
- build
|
|
- deploy
|
|
- release
|
|
|
|
build apk:
|
|
stage: build
|
|
image: lbry/android-base:latest
|
|
before_script:
|
|
- export BUILD_VERSION=$(cat $CI_PROJECT_DIR/src/main/python/main.py | grep --color=never -oP '([0-9]+\.?)+')
|
|
artifacts:
|
|
paths:
|
|
- bin/browser-*-release.apk
|
|
script:
|
|
- export PATH=/usr/bin:$PATH
|
|
- echo "$PGP_PRIVATE_KEY" | gpg --batch --import
|
|
- cd app
|
|
- npm install
|
|
- cd ..
|
|
- wget -q 'https://eu.crystax.net/download/crystax-ndk-10.3.2-linux-x86_64.tar.xz' -P ~/.buildozer/android/
|
|
- tar -xf ~/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz -C ~/.buildozer/android/
|
|
- rm -rf ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
|
|
- ln -s ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21 ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9
|
|
- cp -f $CI_PROJECT_DIR/scripts/build-target-python.sh ~/.buildozer/android/crystax-ndk-10.3.2/build/tools/build-target-python.sh
|
|
- rm ~/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz
|
|
- git secret reveal
|
|
- mv buildozer.spec.travis buildozer.spec
|
|
- "./release.sh | grep -Fv -e 'working:' -e 'copy' -e 'Compiling' --line-buffered"
|
|
- cp $CI_PROJECT_DIR/bin/browser-$BUILD_VERSION-release.apk /dev/null
|
|
|
|
deploy build.lbry.io:
|
|
image: python:latest
|
|
stage: deploy
|
|
dependencies:
|
|
- build apk
|
|
before_script:
|
|
- pip install awscli
|
|
- export BUILD_VERSION=$(cat $CI_PROJECT_DIR/src/main/python/main.py | grep --color=never -oP '([0-9]+\.?)+')
|
|
- export BUILD_APK_FILENAME=browser-$BUILD_VERSION-release.apk
|
|
script:
|
|
- aws s3 cp bin/$BUILD_APK_FILENAME s3://build.lbry.io/android/build-${CI_JOB_ID}_commit-${CI_COMMIT_SHA:0:7}/$BUILD_APK_FILENAME
|
|
- aws s3 cp bin/$BUILD_APK_FILENAME s3://build.lbry.io/android/push.apk
|
|
|
|
release apk:
|
|
image: python:latest
|
|
stage: release
|
|
only:
|
|
- tags
|
|
dependencies:
|
|
- build apk
|
|
before_script:
|
|
- pip install awscli githubrelease
|
|
- export BUILD_VERSION=$(cat $CI_PROJECT_DIR/src/main/python/main.py | grep --color=never -oP '([0-9]+\.?)+')
|
|
- export BUILD_APK_FILENAME=browser-$BUILD_VERSION-release.apk
|
|
script:
|
|
- githubrelease release lbryio/lbry-android create $CI_COMMIT_TAG --publish bin/$BUILD_APK_FILENAME
|
|
- aws s3 cp bin/$BUILD_APK_FILENAME s3://build.lbry.io/android/latest.apk
|