This repository has been archived by the owner on Jan 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
62 additions
and
8 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 |
---|---|---|
@@ -1,19 +1,45 @@ | ||
sudo: false | ||
dist: trusty | ||
language: node_js | ||
|
||
# Support Active LTS versions of Node.js | ||
node_js: | ||
- '8' | ||
- '10' | ||
|
||
branches: | ||
only: | ||
- master | ||
- /^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/ | ||
|
||
addons: | ||
firefox: "latest" | ||
chrome: stable | ||
firefox: latest | ||
|
||
env: | ||
- MOZ_HEADLESS=1 | ||
|
||
script: | ||
- npm test | ||
|
||
install: | ||
- npm install | ||
before_install: | ||
- echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc | ||
|
||
install: | ||
- npm ci | ||
|
||
before_script: | ||
# Needed for Karma test runner | ||
- export DISPLAY=:99.0 | ||
- sh -e /etc/init.d/xvfb start | ||
- sleep 3 # give xvfb some time to start | ||
|
||
script: | ||
- npm run check-package | ||
- npm run lint | ||
- npm run test | ||
|
||
deploy: | ||
- provider: script | ||
skip_cleanup: true | ||
script: bash scripts/travis-deploy.sh | ||
on: | ||
repo: dashevo/dapi-client | ||
tags: true |
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
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#! /bin/sh | ||
|
||
set -xe | ||
|
||
# Update this whenever the latest Node.js LTS version changes (~ every year). | ||
# Do not forget to add this version to .travis.yml config also. | ||
LATEST_LTS_VERSION="10" | ||
|
||
# We want this command to succeed whether or not the Node.js version is the | ||
# latest (so that the build does not show as failed), but _only_ the latest | ||
# should be used to publish the module. | ||
if [[ "$TRAVIS_NODE_VERSION" != "$LATEST_LTS_VERSION" ]]; then | ||
echo "Node.js v$TRAVIS_NODE_VERSION is not latest LTS version -- will not deploy with this version." | ||
exit 0 | ||
fi | ||
|
||
# Ensure the tag matches the one in package.json, otherwise abort. | ||
PACKAGE_TAG=v"$(jq -r .version package.json)" | ||
if [[ "$PACKAGE_TAG" != "$TRAVIS_TAG" ]]; then | ||
echo "Travis tag (\"$TRAVIS_TAG\") is not equal to package.json tag (\"$PACKAGE_TAG\"). Please push a correct tag and try again." | ||
exit 1 | ||
fi | ||
|
||
# Now that checks have been passed, publish the module | ||
npm publish |