-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correctly set npm tag when deploying
- Loading branch information
Showing
1 changed file
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,12 +21,29 @@ notifications: | |
on_success: never | ||
on_failure: always | ||
|
||
# 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: [email protected] | ||
api_key: | ||
secure: Gjd/+7HvWJhVopSDHGirlMjk872jDK+/pW/s1cE5pHFz5Zfbn4wpAuoncQ8oLNwnndPkAMwBzNvwpOfQiCrccIuERY6f73Jtmd+dzGCgf7WRFB1Jz0ih06Xu/CSNN/nApaMMoj++/s/m6lu+NLNOgQ7aYZEEwJyfi3T7ik0AcJ4= | ||
on: | ||
node: 8 | ||
tags: true | ||
repo: astorije/chai-immutable | ||
|
||
# If the current release is a stable release, remove potential pre-release tag | ||
after_deploy: | | ||
if [ "$(npm_dist_tag)" == "latest" ]; then | ||
npm dist-tag rm thelounge next || true | ||
fi |