Skip to content

Commit

Permalink
Check for '-' and build next vs latest
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbieTheWagner committed Jul 3, 2018
1 parent fef0e0c commit 15f6c3b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,18 @@ jobs:
- stage: npm release
script:
- yarn build
# Identifies `a.b.c-xxx.n` tags as pre-releases, and `a.b.c` as stable releases
before_deploy: |
function npm_dist_tag() {
if [[ "$TRAVIS_TAG" = *"-"* ]]; then
echo "next"
else
echo "latest"
fi
}
deploy:
provider: npm
tag: $(npm_dist_tag)
email: rwwagner90@gmail.com
skip_cleanup: true
api_key:
Expand All @@ -29,6 +39,10 @@ jobs:
branch: master
tags: true
repo: shipshapecode/shepherd
after_deploy: |
if [ "$(npm_dist_tag)" == "latest" ]; then
npm dist-tag rm shepherd.js next || true
fi
- stage: gh-pages release
script:
- yarn build
Expand Down

0 comments on commit 15f6c3b

Please sign in to comment.