From 230c0455c8b53d9bc5909b903646bb4cddc6310d Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Tue, 25 Jul 2017 11:58:52 -0700 Subject: [PATCH 1/3] don't notify if running locally --- script/notify | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/script/notify b/script/notify index 781659c2..7c7827a2 100755 --- a/script/notify +++ b/script/notify @@ -1,7 +1,10 @@ #!/bin/bash set -e -if [[ $# -lt 1 ]]; then +if [[ "$CI" != "true" ]]; then + echo "(notify bailing: not in CI)" + exit +elif [[ $# -lt 1 ]]; then echo "No status provided!" >&2 exit 1 fi From 135cc1f9d244dc11f4d32ae75534972533a5132f Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Tue, 25 Jul 2017 12:56:40 -0700 Subject: [PATCH 2/3] nix --bail flag for release-candidate --- script/release-candidate | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/script/release-candidate b/script/release-candidate index f0578fdc..20057757 100755 --- a/script/release-candidate +++ b/script/release-candidate @@ -59,4 +59,6 @@ for module_dir in $module_dirs; do done # publish all the things! -lerna exec --bail=false -- npm publish --tag=$npm_tag +script/notify pending +lerna exec -- npm publish --tag=$npm_tag +script/notify success From 2ac8bc38281cb7c5489f5676cbbd1316651d4516 Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Tue, 25 Jul 2017 12:57:10 -0700 Subject: [PATCH 3/3] add script/try-publish; use in script/release --- script/release | 2 +- script/try-publish | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100755 script/try-publish diff --git a/script/release b/script/release index 2408158a..98f44ce9 100755 --- a/script/release +++ b/script/release @@ -1,4 +1,4 @@ #!/bin/bash set -e echo "📦 Publishing latest release..." -lerna exec -- npm publish +lerna exec -- $(pwd)/script/try-publish diff --git a/script/try-publish b/script/try-publish new file mode 100755 index 00000000..746916af --- /dev/null +++ b/script/try-publish @@ -0,0 +1,12 @@ +#!/bin/bash +set -e +# pwd +package=$(jq .name package.json) +version=$(jq .version package.json) +published=$(npm info "$package@$version") +if [[ "$version" = "$published" ]]; then + echo "⚠️ $package@$version is already published!" +else + echo "📦 npm publish: $package@$version" + npm publish $@ +fi