From 71b45ca752992b7994c5a1f39a1d9dab3fc7f0c1 Mon Sep 17 00:00:00 2001 From: Konstantin Aksenov Date: Wed, 17 Jun 2020 15:11:26 +1000 Subject: [PATCH] Add release automation (#222) * Add release automation * Extract aliase * Add elvis for alias --- .circleci/config.yml | 38 +++++++++++++++++++++++++++++++++ buildsystem/dependencies.gradle | 6 +----- 2 files changed, 39 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e52087a9..30160dcb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -41,6 +41,7 @@ jobs: - image: circleci/android:api-28 environment: JVM_OPTS: -Xmx3200m + BINTRAY_ALIAS: SNAPSHOT steps: - checkout - restore_cache: @@ -185,6 +186,27 @@ jobs: name: Run AT command: sudo gcloud firebase test android run --type instrumentation --app /tmp/artifacts/sample-debug.apk --test /tmp/artifacts/sample-debug-androidTest.apk --device model=Pixel2,version=28,locale=en,orientation=portrait + release-job: + working_directory: ~/code + docker: + - image: circleci/android:api-28 + environment: + JVM_OPTS: -Xmx3200m + steps: + - checkout + - restore_cache: + key: jars-{{ checksum "build.gradle" }}-{{ checksum "sample/build.gradle" }} + - run: + name: Download Dependencies + command: ./gradlew androidDependencies + - save_cache: + paths: + - ~/.gradle + key: jars-{{ checksum "build.gradle" }}-{{ checksum "sample/build.gradle" }} + - run: + name: Publish release + command: ./gradlew build install bintrayUpload + workflows: version: 2 build-deploy: @@ -192,6 +214,9 @@ workflows: - build-job - run-at-approval: type: approval + filters: + branches: + ignore: master - automation-assemble: requires: - build-job @@ -202,17 +227,30 @@ workflows: requires: - automation-assemble - run-at-approval + filters: + branches: + ignore: master - automation-24api: requires: - automation-assemble - run-at-approval + filters: + branches: + ignore: master - automation-28api: requires: - automation-assemble - run-at-approval + filters: + branches: + ignore: master - deploy-job: requires: - build-job filters: branches: only: master + - release-job: + filters: + branches: + only: /^release/.+$/ diff --git a/buildsystem/dependencies.gradle b/buildsystem/dependencies.gradle index 99aa67b6..d3185b6c 100644 --- a/buildsystem/dependencies.gradle +++ b/buildsystem/dependencies.gradle @@ -40,11 +40,7 @@ ext.libraries = [ ] -def alias = System.getenv('BINTRAY_ALIAS') - -if (alias == null) { - alias = '' -} +def alias = System.getenv('BINTRAY_ALIAS') ?: '' def kakaoVersion = new File('buildsystem/version').text.trim() + alias