lbry-fdroid/.gitlab-ci.yml

83 lines
3.7 KiB
YAML
Raw Normal View History

2019-03-26 15:08:50 +01:00
stages:
- build
- deploy
- release
2019-08-10 12:25:57 +01:00
build apk:
2019-03-26 15:08:50 +01:00
stage: build
image: lbry/android-base:platform-28
2019-03-26 15:08:50 +01:00
before_script:
- apt-get -y update && apt-get -y install build-essential ca-certificates curl git gpg-agent openjdk-8-jdk software-properties-common wget zipalign
- wget -q https://nodejs.org/dist/latest-v10.x/node-v10.19.0-linux-x64.tar.gz && tar xf node-v10.19.0-linux-x64.tar.gz -C /opt
- ln -fs /opt/node-v10.19.0-linux-x64/bin/node /usr/bin/node
- ln -fs /opt/node-v10.19.0-linux-x64/bin/npm /usr/bin/npm
- ln -fs /opt/node-v10.19.0-linux-x64/bin/npx /usr/bin/npx
- chmod u+x $CI_PROJECT_DIR/gradlew
- export ANDROID_SDK_ROOT=~/.buildozer/android/platform/android-sdk-23
- export BUILD_VERSION=$($CI_PROJECT_DIR/gradlew -q printVersionName --console=plain | tail -1)
2019-08-10 12:25:57 +01:00
artifacts:
paths:
- bin/browser-*-release__arm.apk
- bin/browser-*-release__arm64.apk
2019-08-10 12:25:57 +01:00
expire_in: 1 week
script:
- export PATH=/usr/bin:$PATH
- echo "$PGP_PRIVATE_KEY" | gpg --batch --import
- curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
- echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
- echo "deb https://dl.bintray.com/sobolevn/deb git-secret main" | tee -a /etc/apt/sources.list
- wget -O - https://api.bintray.com/users/sobolevn/keys/gpg/public.key | apt-key add -
- apt-get -y update && apt-get -y install yarn git-secret
2019-08-10 12:25:57 +01:00
- git secret reveal
- npm install -g react-native-cli
- cd ~/
- git clone https://github.com/lbryio/lbry-react-native
- cd lbry-react-native
- chmod u+x bundle-android.sh
- yarn
- rm -rf android # temporary, should be a submodule init?
- cp -rf $CI_PROJECT_DIR/ android/
- cd android
- chmod u+x ./release.sh
- ./release.sh
- mkdir -p $CI_PROJECT_DIR/bin/ && cp bin/*.apk $CI_PROJECT_DIR/bin/
- cd $CI_PROJECT_DIR
- cp bin/browser-$BUILD_VERSION-release__arm.apk /dev/null
- cp bin/browser-$BUILD_VERSION-release__arm64.apk /dev/null
2019-03-26 15:08:50 +01:00
deploy build.lbry.io:
image: python:stretch
2019-03-26 15:08:50 +01:00
stage: deploy
dependencies:
- build apk
2019-03-26 15:08:50 +01:00
before_script:
- apt-get -y update && apt-get -y install openjdk-8-jdk
2019-03-26 15:08:50 +01:00
- pip install awscli
- chmod u+x $CI_PROJECT_DIR/gradlew
- export BUILD_VERSION=$($CI_PROJECT_DIR/gradlew -q printVersionName --console=plain | tail -1)
2019-08-10 12:25:57 +01:00
- export BUILD_APK_FILENAME__32=browser-$BUILD_VERSION-release__arm.apk
- export BUILD_APK_FILENAME__64=browser-$BUILD_VERSION-release__arm64.apk
2019-03-26 15:08:50 +01:00
script:
2019-08-10 12:25:57 +01:00
- aws s3 cp bin/$BUILD_APK_FILENAME__64 s3://build.lbry.io/android/build-${CI_PIPELINE_IID}_commit-${CI_COMMIT_SHA:0:7}/$BUILD_APK_FILENAME__64
- aws s3 cp bin/$BUILD_APK_FILENAME__32 s3://build.lbry.io/android/build-${CI_PIPELINE_IID}_commit-${CI_COMMIT_SHA:0:7}/$BUILD_APK_FILENAME__32
- aws s3 cp bin/$BUILD_APK_FILENAME__64 s3://build.lbry.io/android/push.apk
2019-03-26 15:08:50 +01:00
release apk:
image: python:stretch
2019-03-26 15:08:50 +01:00
stage: release
only:
- tags
dependencies:
- build apk
2019-03-26 15:08:50 +01:00
before_script:
- apt-get -y update && apt-get -y install openjdk-8-jdk
2019-03-26 15:08:50 +01:00
- pip install awscli githubrelease
- chmod u+x $CI_PROJECT_DIR/gradlew
- export BUILD_VERSION=$($CI_PROJECT_DIR/gradlew -q printVersionName --console=plain | tail -1)
2019-08-10 12:25:57 +01:00
- export BUILD_APK_FILENAME__32=browser-$BUILD_VERSION-release__arm.apk
- export BUILD_APK_FILENAME__64=browser-$BUILD_VERSION-release__arm64.apk
2019-03-26 15:08:50 +01:00
script:
2019-08-10 12:25:57 +01:00
- githubrelease release lbryio/lbry-android create $CI_COMMIT_TAG --publish bin/$BUILD_APK_FILENAME__64 bin/$BUILD_APK_FILENAME__32
2019-08-20 19:57:47 +01:00
- githubrelease release lbryio/lbry-android edit $CI_COMMIT_TAG --draft
2019-08-12 14:33:19 +01:00
- aws s3 cp bin/$BUILD_APK_FILENAME__64 s3://build.lbry.io/android/latest.apk