Skip to content

Commit

Permalink
Merge pull request #87 from Tinder/ahe/automate-snapshot
Browse files Browse the repository at this point in the history
Set up auto deploy of snapshots
  • Loading branch information
Aaron He authored Jul 11, 2019
2 parents ffe7744 + 3cf5883 commit b4fd5fe
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ jobs:
- run: ./gradlew test
- run: mkdir -p $CIRCLE_TEST_REPORTS/junit/
- run: find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \;
- run:
name: Deploy Snapshot
command: ./publish.sh
23 changes: 21 additions & 2 deletions publish.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,21 @@
#!/usr/bin/env bash
./gradlew clean uploadArchives
#!/bin/bash
#
# Deploy a jar, source jar, and javadoc jar to Sonatype's snapshot repo.
#
# Adapted from https://coderwall.com/p/9b_lfq and
# http://benlimmer.com/2013/12/26/automatically-publish-javadoc-to-gh-pages-with-travis-ci/

REPO_URL="[email protected]:Tinder/Scarlet.git"
BRANCH="master"

set -e

if [ "${CIRCLE_REPOSITORY_URL}" != "$REPO_URL" ]; then
echo "Skipping snapshot deployment: wrong repository. Expected '$REPO_URL' but was '${CIRCLE_REPOSITORY_URL}'."
elif [ "${CIRCLE_BRANCH}" != "$BRANCH" ]; then
echo "Skipping snapshot deployment: wrong branch. Expected '$BRANCH' but was '${CIRCLE_BRANCH}'."
else
echo "Deploying snapshot..."
./gradlew clean uploadArchives
echo "Snapshot deployed!"
fi

0 comments on commit b4fd5fe

Please sign in to comment.