From 0e10c2fad300de81777772e04798d4ec3d6f8ec2 Mon Sep 17 00:00:00 2001 From: Chuck Greb Date: Tue, 14 Feb 2017 15:53:54 -0500 Subject: [PATCH] Add Circle CI release config for automated deployments (#71) --- build.gradle | 2 +- circle.yml | 5 +++++ lib/build.gradle | 4 ++-- scripts/deploy-staging.sh | 12 ++++++++++++ 4 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 scripts/deploy-staging.sh diff --git a/build.gradle b/build.gradle index 22a25f6..5fc08bf 100644 --- a/build.gradle +++ b/build.gradle @@ -22,4 +22,4 @@ task clean(type: Delete) { delete rootProject.buildDir } -defaultTasks = ['clean', 'assembleDebug', 'checkstyle', 'copyTask', 'testDebug', 'install'] +defaultTasks = ['clean', 'assembleDebug', 'checkstyle', 'copyTask', 'testDebugUnitTest', 'install'] diff --git a/circle.yml b/circle.yml index dcc7fc2..2e5c132 100644 --- a/circle.yml +++ b/circle.yml @@ -24,3 +24,8 @@ deployment: branch: master commands: - ./gradlew uploadArchives -PsonatypeUsername=$SONATYPE_NEXUS_SNAPSHOTS_USERNAME -PsonatypePassword=$SONATYPE_NEXUS_SNAPSHOTS_PASSWORD + release: + tag: /pelias-android-sdk-[0-9]+(\.[0-9]+)*/ + owner: mapzen + commands: + - scripts/deploy-staging.sh diff --git a/lib/build.gradle b/lib/build.gradle index 4d08ec0..616c8f6 100644 --- a/lib/build.gradle +++ b/lib/build.gradle @@ -25,11 +25,11 @@ version = VERSION_NAME project.archivesBaseName = POM_ARTIFACT_ID release { + tagTemplate = 'pelias-android-sdk-${version}' + versionPropertyFile = '../gradle.properties' versionProperties = ['VERSION_NAME'] } -afterReleaseBuild.dependsOn uploadArchives - task checkstyle(type: Checkstyle) { configFile file("${project.rootDir}/config/checkstyle/checkstyle.xml") source 'src' diff --git a/scripts/deploy-staging.sh b/scripts/deploy-staging.sh new file mode 100644 index 0000000..d8c6811 --- /dev/null +++ b/scripts/deploy-staging.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +# +# Builds, signs, and uploads release AARs to https://oss.sonatype.org/#stagingRepositories. +# + +echo -e "machine github.com\n login $GITHUB_USERNAME\n password $GITHUB_PASSWORD" >> ~/.netrc +git clone https://github.com/mapzen/android-config.git +./gradlew uploadArchives -PsonatypeUsername="$SONATYPE_NEXUS_SNAPSHOTS_USERNAME" \ + -PsonatypePassword="$SONATYPE_NEXUS_SNAPSHOTS_PASSWORD" \ + -Psigning.keyId="$SIGNING_KEY_ID" \ + -Psigning.password="$SIGNING_PASSWORD" \ + -Psigning.secretKeyRingFile="$SIGNING_SECRET_KEY_RING_FILE"