Browse Source

Added Circle CI automatic builds

Now when adding a new tag, Circle CI automagically build a release signed apk and add it to assets.

Signed-off-by: Óscar García Amor <ogarcia@connectical.com>
pull/152/head
Óscar García Amor 4 years ago
parent
commit
23d4715ff1
  1. 56
      .circleci/config.yml
  2. BIN
      ultrasonic-keystore.enc

56
.circleci/config.yml

@ -58,6 +58,48 @@ jobs:
command: |
. ~/venv/bin/activate
tx push -st
generate_signed_apk:
docker:
- image: circleci/android:api-27-alpha
working_directory: ~/ultrasonic
envoronment:
JVM_OPTS: -Xmx3200m
steps:
- checkout
- restore_cache:
key: gradle-cache-{{ checksum "dependencies.gradle" }}
- run:
name: decrypt ultrasonic-keystore
command: openssl aes-256-cbc -K ${ULTRASONIC_KEYSTORE_KEY} -iv ${ULTRASONIC_KEYSTORE_IV} -in ultrasonic-keystore.enc -out ultrasonic-keystore -d
- run:
name: build release apk
command: ./gradlew build assembleRelease
- run:
name: sign release apk
command: |
mkdir -p /tmp/ultrasonic-release
cd ultrasonic/build/outputs/apk/release/
for apk in *.apk; do
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ~/ultrasonic/ultrasonic-keystore -storepass ${ULTRASONIC_KEYSTORE_STOREPASS} -keypass ${ULTRASONIC_KEYSTORE_KEYPASS} ${apk} ultrasonic
jarsigner -verify ${apk}
${ANDROID_HOME}/build-tools/27.0.0/zipalign -v 4 ${apk} /tmp/ultrasonic-release/${apk/-release/}
done
- persist_to_workspace:
root: /tmp/ultrasonic-release
paths:
- ultrasonic-*.apk
publish_signed_apk:
docker:
- image: circleci/golang
steps:
- attach_workspace:
at: /tmp/ultrasonic-release
- run:
name: install ghr
command: go get -v github.com/tcnksm/ghr
- run:
name: publish release on tag
command: ghr -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} ${CIRCLE_TAG} /tmp/ultrasonic-release
workflows:
version: 2
build_and_push_translations:
@ -71,4 +113,18 @@ workflows:
only:
- develop
- master
- generate_signed_apk:
filters:
tags:
only: /^[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/
- publish_signed_apk:
requires:
- generate_signed_apk
filters:
tags:
only: /^[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/

BIN
ultrasonic-keystore.enc

Loading…
Cancel
Save