From a3bcf301bf8e3ae901907938a7d26a29b306d5a6 Mon Sep 17 00:00:00 2001 From: Nick Alexander Date: Wed, 12 Sep 2018 11:39:25 -0700 Subject: [PATCH] Publish logins AAR to nalexander's personal bintray. (Fixes #189) (#199) r=vladikoff,tcsc * Pre: Bump version to 0.3.2. This just needs to be greater than 0.3.1, the last version I pushed in testing. * Publish logins AAR to nalexander's personal bintray. * Post: Bump task timeout for build and publishing. Building everything for three architectures just takes a long time -- 15 minutes per architecture or more. I investigated speeding this up, and I conclude that compiling the architectures in parallel is both work (you need to work around cargo a little bit, and you need to use a Make jobserver to limit the total thread pool) and doesn't pay off (I witnessed only about a 5-10% speed-up locally). My guess is that it pays off even less in AWS, where IO throughput is relatively low and context switching relatively more expensive. --- .taskcluster.yml | 20 +++++++++++++------ .../release/fetch-bintray-api-key.py | 4 +++- logins-api/android/build.gradle | 2 +- logins-api/android/gradle.properties | 10 ++++++++++ 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/.taskcluster.yml b/.taskcluster.yml index b437efe57e..594767c8d6 100644 --- a/.taskcluster.yml +++ b/.taskcluster.yml @@ -53,9 +53,11 @@ tasks: github: events: - release + scopes: + - "secrets:get:project/application-services/publish" payload: - maxRunTime: 3600 - deadline: "{{ '2 hours' | $fromNow }}" + maxRunTime: 7200 + deadline: "{{ '4 hours' | $fromNow }}" image: 'mozillamobile/rust-component:buildtools-27.0.3-ndk-r15c-ndk-version-21-rust-stable-rust-beta' command: - /bin/bash @@ -66,7 +68,11 @@ tasks: && cd application-services && git config advice.detachedHead false && git checkout '{{ event.version }}' + && python automation/taskcluster/release/fetch-bintray-api-key.py && ./scripts/taskcluster-android.sh + && cd logins-api/android + && ./gradlew --no-daemon clean library:assembleRelease + && ./gradlew bintrayUpload --debug -PvcsTag="{{ event.head.sha }}" artifacts: 'public/bin/mozilla/fxa_client_android_{{ event.version }}.zip': type: 'file' @@ -88,9 +94,11 @@ tasks: github: events: - tag + scopes: + - "secrets:get:project/application-services/publish" payload: - maxRunTime: 3600 - deadline: "{{ '2 hours' | $fromNow }}" + maxRunTime: 7200 + deadline: "{{ '4 hours' | $fromNow }}" image: 'mozillamobile/rust-component:buildtools-27.0.3-ndk-r15c-ndk-version-21-rust-stable-rust-beta' command: - /bin/bash @@ -101,11 +109,11 @@ tasks: && cd application-services && git config advice.detachedHead false && git checkout '{{ event.head.tag }}' + && python automation/taskcluster/release/fetch-bintray-api-key.py && ./scripts/taskcluster-android.sh - # && python automation/taskcluster/release/fetch-bintray-api-key.py && cd logins-api/android && ./gradlew --no-daemon clean library:assembleRelease - # && VCS_TAG=`git show-ref {{ event.head.tag }}` ./gradlew bintrayUpload --debug -PvcsTag="$VCS_TAG" + && ./gradlew bintrayUpload --debug -PvcsTag="{{ event.head.sha }}" artifacts: 'public/bin/mozilla/fxa_client_android_{{ event.head.tag }}.zip': type: 'file' diff --git a/automation/taskcluster/release/fetch-bintray-api-key.py b/automation/taskcluster/release/fetch-bintray-api-key.py index 0e78108bbc..844b1588c3 100644 --- a/automation/taskcluster/release/fetch-bintray-api-key.py +++ b/automation/taskcluster/release/fetch-bintray-api-key.py @@ -5,7 +5,7 @@ import os import taskcluster -SECRET_NAME = 'project/mentat/publish' +SECRET_NAME = 'project/application-services/publish' TASKCLUSTER_BASE_URL = 'http://taskcluster/secrets/v1' @@ -19,7 +19,9 @@ def main(): """Fetch the bintray user and api key from taskcluster's secret service and save it to local.properties in the project root directory. """ + print('fetching {} ...'.format(SECRET_NAME)) data = fetch_publish_secrets(SECRET_NAME) + print('fetching {} ... DONE ({} bytes)'.format(SECRET_NAME, len(str(data)))) properties_file_path = os.path.join(os.path.dirname(__file__), '../../../logins-api/android/local.properties') with open(properties_file_path, 'w') as properties_file: diff --git a/logins-api/android/build.gradle b/logins-api/android/build.gradle index 7bf43bbb9a..8bf6bf9e80 100644 --- a/logins-api/android/build.gradle +++ b/logins-api/android/build.gradle @@ -4,7 +4,7 @@ buildscript { ext.kotlin_version = '1.2.50' ext.library = [ - version: '0.2.0' + version: '0.3.2' ] ext.build = [ diff --git a/logins-api/android/gradle.properties b/logins-api/android/gradle.properties index 743d692ce1..756121dbe5 100644 --- a/logins-api/android/gradle.properties +++ b/logins-api/android/gradle.properties @@ -11,3 +11,13 @@ org.gradle.jvmargs=-Xmx1536m # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true + +libGroupId=org.mozilla.sync15 +libRepositoryName=application-services +libProjectName=application-services +libProjectDescription=Firefox Application Services +libUrl=https://github.com/mozilla/application-services +libVcsUrl=https://github.com/mozilla/application-services.git + +libLicense=MPL-2.0 +libLicenseUrl=https://www.mozilla.org/en-US/MPL/2.0/