Skip to content

Commit

Permalink
chore(CircleCI) Publish on tag builds
Browse files Browse the repository at this point in the history
We don't want to publish on branch builds so we need to check that CIRCLE_TAG is present.
  • Loading branch information
guillaume-tgl committed Sep 5, 2018
1 parent 2f5f79a commit f9149ce
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,24 @@ jobs:
- run:
name: Publish on Maven
command: |
VERSION=$(git tag --points-at HEAD) # Get current tag if any
echo $CIRCLE_TAG
# Check correct tag format, strip leading "v" and publish
if [[ $VERSION =~ ^v(.*)$ ]]; then
if [[ $CIRCLE_TAG =~ ^v(.*)$ ]]; then
VERSION=${BASH_REMATCH[1]}
./gradlew bintrayUpload -PgitVersion=$VERSION
fi
- store_artifacts:
path: build/reports
destination: reports
- store_test_results:
path: build/test-results
path: build/test-results

workflows:
version: 2
build-workflow:
jobs:
- build:
filters:
tags:
only: /^v.*/

0 comments on commit f9149ce

Please sign in to comment.