From 23d4715ff1099a9a3c212d912574da744b3df315 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20Garc=C3=ADa=20Amor?= Date: Thu, 25 Jan 2018 18:46:23 +0100 Subject: [PATCH 1/2] Added Circle CI automatic builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .circleci/config.yml | 56 ++++++++++++++++++++++++++++++++++++++++ ultrasonic-keystore.enc | Bin 0 -> 2224 bytes 2 files changed, 56 insertions(+) create mode 100644 ultrasonic-keystore.enc diff --git a/.circleci/config.yml b/.circleci/config.yml index f699d294..c7460064 100644 --- a/.circleci/config.yml +++ b/.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: /.*/ diff --git a/ultrasonic-keystore.enc b/ultrasonic-keystore.enc new file mode 100644 index 0000000000000000000000000000000000000000..3c818567d01e56a5b420e17895ea1593ecb6b262 GIT binary patch literal 2224 zcmV;h2v7I;XJh}Jv8t4c3rtl-jd8M0ot81R1a1&Kd)0k+vyRQ0NYL2D5G2<(ti$dw z*Nf)vVeBRgwqdV=Q@kmhy8+A^Df&=i+n|sB>W(0YK8~yaA5M`5KIGELD~Pcu*M_ys zAjFD`h}5`Pv)@VithSwoV=~{?mo#wdY8}r~05F=!LOXJjVAW6qSt02Zb#{>Usfsjf zce>rTE$$M|>@v>kI)e^aPPZUAK>hX6P*rcO4#as&na|^{TEm4UsZ&_YXG#qaRM8^0 zE6qQ&<+Z8XPy-*S?zyth%UK(8WGxGZcH}=Vhg7c<7Hb0ce2ztW+|Wpf=J=S)LuOai zjil2H=0AivvtGlSd#z3fnlp;cV3wSjy<-asfVuU?ZLlNRfKCE!9?1HnR;kVus)grqSmMwB$tAbyLWJ)KtflG>9B7dnN7FWm?8w4cm&^iYwPpDgCrb z9M32#>(nYoHEuX?xfl&00QRe!UAP{{_~^MCr31tu_lhvy)MR|IisNhald^lW{kV0; z#6mgh)~Tjqxd~KSmu&BlemMZCw>+ zCN()WDBNRR-Y4Shfr(~^f?EB}L2WEyDI(vU7JRCqac)hJab%}_&p%U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Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Óscar García Amor --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c7460064..9c7e2e20 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -63,7 +63,7 @@ jobs: - image: circleci/android:api-27-alpha working_directory: ~/ultrasonic envoronment: - JVM_OPTS: -Xmx3200m + JAVA_TOOL_OPTIONS: "-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap" steps: - checkout - restore_cache: @@ -88,7 +88,7 @@ jobs: root: /tmp/ultrasonic-release paths: - ultrasonic-*.apk - publish_signed_apk: + publish_github_signed_apk: docker: - image: circleci/golang steps: @@ -98,7 +98,7 @@ jobs: name: install ghr command: go get -v github.com/tcnksm/ghr - run: - name: publish release on tag + name: publish release on github tag command: ghr -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} ${CIRCLE_TAG} /tmp/ultrasonic-release workflows: version: 2 @@ -119,7 +119,7 @@ workflows: only: /^[0-9]+(\.[0-9]+)*/ branches: ignore: /.*/ - - publish_signed_apk: + - publish_github_signed_apk: requires: - generate_signed_apk filters: