Gitlab CI (#498)
This commit is contained in:
parent
d8b0e89c6c
commit
f30f1f47d5
9 changed files with 62 additions and 2 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -9,3 +9,5 @@ src/main/assets/index.android.bundle.meta
|
||||||
*.log
|
*.log
|
||||||
.vagrant
|
.vagrant
|
||||||
|
|
||||||
|
lbry-android.keystore
|
||||||
|
.gitsecret/keys/random_seed
|
||||||
|
|
57
.gitlab-ci.yml
Normal file
57
.gitlab-ci.yml
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
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
|
0
.gitsecret/keys/mapping.cfg
Normal file
0
.gitsecret/keys/mapping.cfg
Normal file
BIN
.gitsecret/keys/pubring.kbx
Normal file
BIN
.gitsecret/keys/pubring.kbx
Normal file
Binary file not shown.
BIN
.gitsecret/keys/pubring.kbx~
Normal file
BIN
.gitsecret/keys/pubring.kbx~
Normal file
Binary file not shown.
BIN
.gitsecret/keys/trustdb.gpg
Normal file
BIN
.gitsecret/keys/trustdb.gpg
Normal file
Binary file not shown.
1
.gitsecret/paths/mapping.cfg
Normal file
1
.gitsecret/paths/mapping.cfg
Normal file
|
@ -0,0 +1 @@
|
||||||
|
lbry-android.keystore:
|
BIN
lbry-android.keystore.secret
Normal file
BIN
lbry-android.keystore.secret
Normal file
Binary file not shown.
|
@ -1,9 +1,9 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
cd app
|
cd app
|
||||||
react-native bundle --platform android --dev false --entry-file src/index.js --bundle-output ../src/main/assets/index.android.bundle --assets-dest ../src/main/res/
|
react-native bundle --platform android --dev false --entry-file src/index.js --bundle-output ../src/main/assets/index.android.bundle --assets-dest ../src/main/res/
|
||||||
cd ..
|
cd ..
|
||||||
version=$(cat src/main/python/main.py | grep --color=never -oP '([0-9]+\.?)+')
|
version=$(cat src/main/python/main.py | grep --color=never -oP '([0-9]+\.?)+')
|
||||||
buildozer android release
|
buildozer android release <<< y
|
||||||
jarsigner -verbose -sigalg SHA1withRSA \
|
jarsigner -verbose -sigalg SHA1withRSA \
|
||||||
-digestalg SHA1 \
|
-digestalg SHA1 \
|
||||||
-keystore lbry-android.keystore \
|
-keystore lbry-android.keystore \
|
||||||
|
|
Loading…
Reference in a new issue