From d2e76e1d4b956d1f12a02bc73ffcd55f2318a5c9 Mon Sep 17 00:00:00 2001 From: Kai Mallea Date: Sat, 10 Aug 2019 20:00:48 -0400 Subject: [PATCH] build: use travisci to publish to npm automatically --- .npmignore | 3 +++ .travis.yml | 26 ++++++++++++++++++++++---- package.json | 3 +++ 3 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 .npmignore diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..a74047c --- /dev/null +++ b/.npmignore @@ -0,0 +1,3 @@ +*.tsbuildinfo +.cache +coverage \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 3e136e3..8c38b09 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,28 @@ language: node_js node_js: - - "12" -cache: yarn -install: - - yarn + - '10' + - '12' +cache: + yarn: true + directories: + - node_modules +before_install: + - curl -o- -L https://yarnpkg.com/install.sh | bash -s + - export PATH="$HOME/.yarn/bin:$PATH" script: - yarn lint - yarn test - yarn build +jobs: + include: + - stage: release + node_js: lts/* + script: skip # do not run tests again + deploy: + provider: script + skip_cleanup: true + script: + - yarn release + on: + branch: master + diff --git a/package.json b/package.json index c9a4e79..0880593 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,8 @@ { "name": "ismobilejs", + "publishConfig": { + "access": "public" + }, "version": "0.5.2", "description": "A simple JS library that detects mobile devices.", "keywords": [