Skip to content

Commit

Permalink
Add Circle CI release config for automated deployments (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
ecgreb authored and sarahsnow1 committed Feb 14, 2017
1 parent 30d32dc commit 0e10c2f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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']
5 changes: 5 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
12 changes: 12 additions & 0 deletions scripts/deploy-staging.sh
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 0e10c2f

Please sign in to comment.