From d6c5ad2de4b8750fbcd217c466662575eec08032 Mon Sep 17 00:00:00 2001 From: jfusco Date: Sat, 18 Mar 2017 15:38:14 -0400 Subject: [PATCH] Remove travis npm publish and fix formatting of travis config --- .travis.yml | 11 +++---- travis-npm-publish | 73 ---------------------------------------------- 2 files changed, 4 insertions(+), 80 deletions(-) delete mode 100644 travis-npm-publish diff --git a/.travis.yml b/.travis.yml index 311034e..6f6365b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,10 @@ language: node_js -node_js: - - "7" -before_install: - - npm install -g eslint -script: - - "npm test" +node_js: "7" +before_install: npm install -g eslint +script: "npm test" deploy: provider: npm email: "jfusco311@gmail.com" api_key: "5987c9ee-ecdc-4642-af28-cf0222230457" on: - tags: true + tags: true diff --git a/travis-npm-publish b/travis-npm-publish deleted file mode 100644 index 6b1f40e..0000000 --- a/travis-npm-publish +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash - -# travis-npm-publish by RafaƂ Pocztarski -# See: https://github.com/rsp/travis-npm-publish - -npm_config="spin=false progress=false color=false" - -echo "Starting travis-npm-publish" -echo "Usage: travis-npm-publish [USER] [BRANCH]" - -user=$1 -branch=$2 -[ "$branch" == "" ] && branch=tags - -[ "$user" == "" ] \ - && echo "Publishing for all github users" \ - || echo "Publishing only for github user $user" - -[ "$branch" == "tags" ] \ - && echo "Publishing builds with git tags that match version in package.json" \ - || echo "Publishing builds on branch $branch" - -echo -e "Using npm config:\n${npm_config// /\n}" - -skip() { - echo "Skipping deployment" $1; exit 0 -} -commands() { - for c in $@; do - command -v $c >/dev/null 2>&1 || skip "without $c" - done -} - -commands node npm curl -[ -f ~/.npmrc-bak ] && skip "with ~/.npmrc-bak already present" -[ -f package.json ] || skip "without package.json" -n=`node -e 'console.log(require("./package.json").name)'` -v=`node -e 'console.log(require("./package.json").version)'` -echo "Deployment of $n@$v" -[ "$TRAVIS" == true ] || skip "not in Travis" -[ "$NPM_AUTH" == "" ] && skip "without NPM_AUTH" -[ "$TRAVIS_PULL_REQUEST" == false ] || skip "for pull request" - -if [ "$branch" == "tags" ]; then - [ -z "$TRAVIS_TAG" ] && tag="no tag" || tag="tag: $TRAVIS_TAG" - [ "${TRAVIS_TAG//v/}" == $v ] || skip "for $tag" -else - [ "$TRAVIS_BRANCH" == "$branch" ] || skip "on branch $TRAVIS_BRANCH" -fi - -if [ "$user" == "" ]; then - [ "${TRAVIS_REPO_SLUG//.*\//}" == "$n" ] || skip "in repo $TRAVIS_REPO_SLUG" -else - [ "$TRAVIS_REPO_SLUG" == "$user/$n" ] || skip "in repo $TRAVIS_REPO_SLUG" -fi - -u=https://registry.npmjs.org/$n/$v -s=`curl -s -o /dev/null -w "%{http_code}" $u` -echo "$u ($s)" -if [ "$s" == 200 ]; then - echo "$n@$v is already published" - exit 0 -elif [ "$s" == 404 ]; then - echo "Publishing $n@$v ..." - [ -f ~/.npmrc ] && mv -v ~/.npmrc ~/.npmrc-bak - echo -e "${npm_config// /\n}\n$NPM_AUTH" > ~/.npmrc - npm publish - rm -fv ~/.npmrc - [ -f ~/.npmrc-bak ] && mv -v ~/.npmrc-bak ~/.npmrc -else - echo "Unexpected registry status code: $s" - exit 1 -fi