From 66a014ab62559ee38ca43f4695271defe36456e7 Mon Sep 17 00:00:00 2001 From: Johnathan Constance Date: Mon, 20 Apr 2020 11:23:11 -0400 Subject: [PATCH 1/3] Reminder to Allow Edits From Maintainers --- .github/PULL_REQUEST_TEMPLATE.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 121a4095..ff89b601 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -8,3 +8,5 @@ Fixes #0000 * Change 1 * Change 2 + + From 9da58ac7c54e950afb4b44ae9a49e4449df302f8 Mon Sep 17 00:00:00 2001 From: Johnathan Constance Date: Tue, 21 Apr 2020 00:31:21 -0400 Subject: [PATCH 2/3] Only Deploy if Version is Updated We want to move to a model where we don't require committers to bump the version number themselves, as this makes merging in the PRs annoying. So instead, let's only deploy if the version number in package.json has changed. Also fixed some annoying whitespace inconsistency. --- .travis.yml | 17 +++++++++++------ scripts/versionCheck.sh | 19 ------------------- 2 files changed, 11 insertions(+), 25 deletions(-) delete mode 100644 scripts/versionCheck.sh diff --git a/.travis.yml b/.travis.yml index 14fb2308..4f768b5d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,20 @@ language: node_js node_js: -- 10.4.0 + - 10.4.0 before_install: - npm i -g npm@6.4.1 install: -- npm install + - npm install script: -- npm run lint -- bash scripts/versionCheck.sh $TRAVIS_BRANCH $TRAVIS_PULL_REQUEST -- npm test + - npm run lint + - npm test before_deploy: -- npm run build + # Only deploy if the version number has changed + - | + if git diff --unified=0 $TRAVIS_COMMIT_RANGE package.json | grep version ; then + export VERSION_CHANGED="yes" + npm run build + fi deploy: skip_cleanup: true provider: npm @@ -18,3 +22,4 @@ deploy: api_key: $NPM_KEY on: branch: master + condition: "$VERSION_CHANGED == 'yes'" diff --git a/scripts/versionCheck.sh b/scripts/versionCheck.sh deleted file mode 100644 index 130650b8..00000000 --- a/scripts/versionCheck.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -set -e # halt script on error - -TARGET_BRANCH=$1 -IS_PULL_REQUEST=$2 # false if not a pull request, - -# Makes sure travis checks version only if doing a pull request -if [ "$IS_PULL_REQUEST" != "false" ] - then - PACKAGE_VERSION=$(grep version package.json | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d ':space:') && echo "Package Version: $PACKAGE_VERSION" - CURRENT_PACKAGE_VERSION=$(git show 'origin/'"$TARGET_BRANCH"':package.json' | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d ':space:') && echo "Latest Version: $CURRENT_PACKAGE_VERSION" - - if [ "$CURRENT_PACKAGE_VERSION" = "$PACKAGE_VERSION" ] - then - echo "Failure reason: Version number should be bumped." - exit 1 - fi -fi From 272e1b7c3af2718b435f8b8b6a45f986c783f591 Mon Sep 17 00:00:00 2001 From: Johnathan Constance Date: Tue, 21 Apr 2020 01:23:01 -0400 Subject: [PATCH 3/3] Move this up so it actually gets set --- .travis.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4f768b5d..4e7c8d72 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,11 @@ language: node_js node_js: - 10.4.0 before_install: + # Only deploy if the version number has changed + - | + if git diff --unified=0 $TRAVIS_COMMIT_RANGE package.json | grep version ; then + export VERSION_CHANGED="yes" + fi - npm i -g npm@6.4.1 install: - npm install @@ -9,12 +14,7 @@ script: - npm run lint - npm test before_deploy: - # Only deploy if the version number has changed - - | - if git diff --unified=0 $TRAVIS_COMMIT_RANGE package.json | grep version ; then - export VERSION_CHANGED="yes" - npm run build - fi + - npm run build deploy: skip_cleanup: true provider: npm