From 780dd32e7fcc77fad711492469726fb8a0f1bf5c Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Thu, 13 Jul 2017 13:35:44 -0700 Subject: [PATCH 01/24] add commit-status dev dependency --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 9fbd496d..34d1d7a1 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "test": "lerna run test" }, "devDependencies": { + "commit-status": "^4.1.0", "lerna": "^2.0.0" } } From 5c2fb084721a00dbe4f383f08f906e22f05c71a8 Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Thu, 13 Jul 2017 13:36:17 -0700 Subject: [PATCH 02/24] send PR commit status w/canary version --- script/cibuild | 3 +++ 1 file changed, 3 insertions(+) diff --git a/script/cibuild b/script/cibuild index 7ac7c1b4..e340b113 100755 --- a/script/cibuild +++ b/script/cibuild @@ -9,6 +9,9 @@ args=${@:1} if [[ $TRAVIS_EVENT_TYPE = pull_request ]]; then echo "🐦 Publishing canary version..." npm run release-canary -- ${args} + version=`jq -r .version module/primer-css/package.json` + echo "📡 Transmitting release success for primer-css@${version} ..." + commit-status success npm/publish/pr "${version}" # merges to dev build a release candidate elif [[ $TRAVIS_BRANCH = dev ]]; then echo "👌 Publishing release candidate..." From e34dd9dc5cb3e10bada455ac1e5ccf6c0c754344 Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Thu, 13 Jul 2017 13:51:28 -0700 Subject: [PATCH 03/24] replace install step w/lerna bootstrap --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index bb7845a3..7b48aa58 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: node_js node_js: - 7 -before_script: +install: - npm config set "//registry.npmjs.org/:_authToken=\${NPM_API_KEY}" - lerna bootstrap From cb3c339785f6720dd0b8a6c73f07ad72e9d34b59 Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Thu, 13 Jul 2017 13:51:42 -0700 Subject: [PATCH 04/24] add back --no-git to skip resetting --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 34d1d7a1..ab1189c8 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "updated": "lerna updated", "release": "lerna publish", "release-candidate": "lerna publish --npm-tag=rc", - "release-canary": "lerna publish --npm-tag=canary --canary", + "release-canary": "lerna publish --npm-tag=canary --canary --no-git", "test": "lerna run test" }, "devDependencies": { From 1b757daaf33f78513babed9bbda99e5674428864 Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Thu, 13 Jul 2017 13:52:10 -0700 Subject: [PATCH 05/24] fix typo --- script/cibuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/cibuild b/script/cibuild index e340b113..3ce0ec49 100755 --- a/script/cibuild +++ b/script/cibuild @@ -9,7 +9,7 @@ args=${@:1} if [[ $TRAVIS_EVENT_TYPE = pull_request ]]; then echo "🐦 Publishing canary version..." npm run release-canary -- ${args} - version=`jq -r .version module/primer-css/package.json` + version=`jq -r .version modules/primer-css/package.json` echo "📡 Transmitting release success for primer-css@${version} ..." commit-status success npm/publish/pr "${version}" # merges to dev build a release candidate From 403a62b37ab34d5f79f3376ee49a50242d6dea0f Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Thu, 13 Jul 2017 13:55:48 -0700 Subject: [PATCH 06/24] :rage1: you can't run lerna if you don't install it first --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7b48aa58..0bdc8cf6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,12 +2,12 @@ language: node_js node_js: - 7 -install: - - npm config set "//registry.npmjs.org/:_authToken=\${NPM_API_KEY}" +after_install: - lerna bootstrap script: - npm test after_success: + - npm config set "//registry.npmjs.org/:_authToken=\${NPM_API_KEY}" - script/cibuild --yes From d0828c1e7d5aabdf66ff91c5849b652afcffa25b Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Thu, 13 Jul 2017 13:57:57 -0700 Subject: [PATCH 07/24] :rage2: running out of rage emoji here --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0bdc8cf6..c9989e25 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: node_js node_js: - 7 -after_install: +before_script: - lerna bootstrap script: From 8253efa194095636214321d53eadb82236681824 Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Thu, 13 Jul 2017 14:09:04 -0700 Subject: [PATCH 08/24] :rage3: output some SHAs --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index c9989e25..cc64eced 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,9 @@ node_js: - 7 before_script: + - echo "TRAVIS_COMMIT: ${TRAVIS_COMMIT}" + - echo "TRAVIS_PULL_REQUEST_SHA: ${TRAVIS_PULL_REQUEST_SHA}" + - exit 1 - lerna bootstrap script: From 9c4aaa93cd655195b2885756b5eab81e972eed46 Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Thu, 13 Jul 2017 14:11:54 -0700 Subject: [PATCH 09/24] :rage4: let's try this again... --- .travis.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index cc64eced..5f08ebd4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,10 +2,12 @@ language: node_js node_js: - 7 -before_script: - - echo "TRAVIS_COMMIT: ${TRAVIS_COMMIT}" - - echo "TRAVIS_PULL_REQUEST_SHA: ${TRAVIS_PULL_REQUEST_SHA}" +before_install: + - echo "commit: $TRAVIS_COMMIT" + - echo "pr SHA: $TRAVIS_PULL_REQUEST_SHA" - exit 1 + +before_script: - lerna bootstrap script: From d6cbe541c1bcf86a4040ca0fd71fa4d721fb3ea4 Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Thu, 13 Jul 2017 14:14:46 -0700 Subject: [PATCH 10/24] :feelsgood: you gotta be kidding me --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5f08ebd4..59d472d3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,8 +3,8 @@ node_js: - 7 before_install: - - echo "commit: $TRAVIS_COMMIT" - - echo "pr SHA: $TRAVIS_PULL_REQUEST_SHA" + - echo $TRAVIS_COMMIT + - echo $TRAVIS_PULL_REQUEST_SHA - exit 1 before_script: From b1b6d90764671576c647e363894d367bf1b5cbcf Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Thu, 13 Jul 2017 14:23:34 -0700 Subject: [PATCH 11/24] :finnadie: ok, let's see the git log --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 59d472d3..a8a7aa2b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ node_js: before_install: - echo $TRAVIS_COMMIT - echo $TRAVIS_PULL_REQUEST_SHA + - git log -3 - exit 1 before_script: From 79fb20d5ab752550c6c5e8dadcfb6ef47394fb98 Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Thu, 13 Jul 2017 14:32:48 -0700 Subject: [PATCH 12/24] :godmode: try my fix for commit-status --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ab1189c8..adb4ca80 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "test": "lerna run test" }, "devDependencies": { - "commit-status": "^4.1.0", + "commit-status": "github:shawnbot/commit-status", "lerna": "^2.0.0" } } From 3ee56c35fb9f37d093c75a57034c36e20d5741bb Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Thu, 13 Jul 2017 14:34:54 -0700 Subject: [PATCH 13/24] :suspect: and don't bail --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index a8a7aa2b..b8924895 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,8 +5,6 @@ node_js: before_install: - echo $TRAVIS_COMMIT - echo $TRAVIS_PULL_REQUEST_SHA - - git log -3 - - exit 1 before_script: - lerna bootstrap From 5b0b9c56659683f623cd6dbdfb1b4674d1f055c0 Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Thu, 13 Jul 2017 14:55:15 -0700 Subject: [PATCH 14/24] remove debugging output --- .travis.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index b8924895..c9989e25 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,10 +2,6 @@ language: node_js node_js: - 7 -before_install: - - echo $TRAVIS_COMMIT - - echo $TRAVIS_PULL_REQUEST_SHA - before_script: - lerna bootstrap From a22c2e5b7300b42afd0acd9bb2476ee6bf8e1d09 Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Thu, 13 Jul 2017 14:55:31 -0700 Subject: [PATCH 15/24] switch back to published commit-status --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index adb4ca80..ab1189c8 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "test": "lerna run test" }, "devDependencies": { - "commit-status": "github:shawnbot/commit-status", + "commit-status": "^4.1.0", "lerna": "^2.0.0" } } From 548772d6d5309b7a9331734eb51390c94aa01abc Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Thu, 13 Jul 2017 14:55:50 -0700 Subject: [PATCH 16/24] try setting TRAVIS_COMMIT inline --- script/cibuild | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script/cibuild b/script/cibuild index 3ce0ec49..2d00a61d 100755 --- a/script/cibuild +++ b/script/cibuild @@ -11,7 +11,8 @@ if [[ $TRAVIS_EVENT_TYPE = pull_request ]]; then npm run release-canary -- ${args} version=`jq -r .version modules/primer-css/package.json` echo "📡 Transmitting release success for primer-css@${version} ..." - commit-status success npm/publish/pr "${version}" + TRAVIS_COMMIT=$TRAVIS_PULL_REQUEST_SHA \ + commit-status success npm/publish/pr "${version}" # merges to dev build a release candidate elif [[ $TRAVIS_BRANCH = dev ]]; then echo "👌 Publishing release candidate..." From 6325c214ce306315f283b29aa33ca69ca6faa743 Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Thu, 13 Jul 2017 15:15:40 -0700 Subject: [PATCH 17/24] tidy up status reporting --- script/cibuild | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/script/cibuild b/script/cibuild index 2d00a61d..595178aa 100755 --- a/script/cibuild +++ b/script/cibuild @@ -4,15 +4,16 @@ set -e # --yes gets passed in by .travis.yml, # which makes this easier to test locally args=${@:1} +package=primer-css # always publish a canary release if this is a PR build if [[ $TRAVIS_EVENT_TYPE = pull_request ]]; then echo "🐦 Publishing canary version..." npm run release-canary -- ${args} - version=`jq -r .version modules/primer-css/package.json` - echo "📡 Transmitting release success for primer-css@${version} ..." + version=`jq -r .version modules/${package}/package.json` + echo "📡 Transmitting release success for ${package}@${version} ..." TRAVIS_COMMIT=$TRAVIS_PULL_REQUEST_SHA \ - commit-status success npm/publish/pr "${version}" + commit-status success npm/publish/pr "📦 npm install ${package}@${version}" # merges to dev build a release candidate elif [[ $TRAVIS_BRANCH = dev ]]; then echo "👌 Publishing release candidate..." From b9fb9565b3c24612e17cd3dd4eb135664df3f522 Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Thu, 13 Jul 2017 15:25:16 -0700 Subject: [PATCH 18/24] remove unicode char from status message --- script/cibuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/cibuild b/script/cibuild index 595178aa..e5b866e3 100755 --- a/script/cibuild +++ b/script/cibuild @@ -13,7 +13,7 @@ if [[ $TRAVIS_EVENT_TYPE = pull_request ]]; then version=`jq -r .version modules/${package}/package.json` echo "📡 Transmitting release success for ${package}@${version} ..." TRAVIS_COMMIT=$TRAVIS_PULL_REQUEST_SHA \ - commit-status success npm/publish/pr "📦 npm install ${package}@${version}" + commit-status success npm/publish/pr "npm install ${package}@${version}" # merges to dev build a release candidate elif [[ $TRAVIS_BRANCH = dev ]]; then echo "👌 Publishing release candidate..." From 583f65093b00f054b3c7f0818dd8c69dc7e2ea01 Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Thu, 13 Jul 2017 16:09:10 -0700 Subject: [PATCH 19/24] call out to scripts --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index ab1189c8..f61e59c2 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,9 @@ "clean": "lerna clean", "diff": "lerna diff", "updated": "lerna updated", - "release": "lerna publish", - "release-candidate": "lerna publish --npm-tag=rc", - "release-canary": "lerna publish --npm-tag=canary --canary --no-git", + "release-canary": "script/release-canary", + "release-candidate": "script/release-candidate", + "release": "script/release", "test": "lerna run test" }, "devDependencies": { From d8e4ddaf3d0a92892bd784c68bcac5def47f3822 Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Thu, 13 Jul 2017 16:09:47 -0700 Subject: [PATCH 20/24] isolate release-canary script for easier testing --- script/cibuild | 8 +------- script/release-canary | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 7 deletions(-) create mode 100644 script/release-canary diff --git a/script/cibuild b/script/cibuild index e5b866e3..d9bbb831 100755 --- a/script/cibuild +++ b/script/cibuild @@ -4,16 +4,10 @@ set -e # --yes gets passed in by .travis.yml, # which makes this easier to test locally args=${@:1} -package=primer-css # always publish a canary release if this is a PR build if [[ $TRAVIS_EVENT_TYPE = pull_request ]]; then - echo "🐦 Publishing canary version..." - npm run release-canary -- ${args} - version=`jq -r .version modules/${package}/package.json` - echo "📡 Transmitting release success for ${package}@${version} ..." - TRAVIS_COMMIT=$TRAVIS_PULL_REQUEST_SHA \ - commit-status success npm/publish/pr "npm install ${package}@${version}" + script/release-canary ${args} # merges to dev build a release candidate elif [[ $TRAVIS_BRANCH = dev ]]; then echo "👌 Publishing release candidate..." diff --git a/script/release-canary b/script/release-canary new file mode 100644 index 00000000..286dff7a --- /dev/null +++ b/script/release-canary @@ -0,0 +1,25 @@ +#!/bin/bash +set -e + +args=${@:1} +package=primer-css +# the commit status context +context=npm/publish/pr + +echo "🐦 Publishing canary version..." +lerna publish --npm-tag=canary --canary --no-git ${args} + +# get the canary version of primer-css from its package.json +version=`jq -r .version modules/${package}/package.json` +slug="${package}@${version}" + +echo "📡 Transmitting release success for ${slug} ..." + +if [[ $TRAVIS_PULL_REQUEST_SHA ]]; then + # setting TRAVIS_COMMIT inline here is a fix for: + # + TRAVIS_COMMIT=$TRAVIS_PULL_REQUEST_SHA \ + commit-status success ${context} \ + "npm install ${slug}" \ + "https://unpkg.com/${slug}/build/build.css" +fi From 8d636f65f87cbab9336daf99a72c352a8afc3a00 Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Thu, 13 Jul 2017 16:11:38 -0700 Subject: [PATCH 21/24] isolate rc and release scripts --- script/cibuild | 6 ++---- script/release | 4 ++++ script/release-candidate | 4 ++++ 3 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 script/release create mode 100644 script/release-candidate diff --git a/script/cibuild b/script/cibuild index d9bbb831..6d197a4a 100755 --- a/script/cibuild +++ b/script/cibuild @@ -10,12 +10,10 @@ if [[ $TRAVIS_EVENT_TYPE = pull_request ]]; then script/release-canary ${args} # merges to dev build a release candidate elif [[ $TRAVIS_BRANCH = dev ]]; then - echo "👌 Publishing release candidate..." - echo npm run release-candidate -- ${args} + script/release-candidate ${args} # publish a release when we merge to master elif [[ $TRAVIS_BRANCH = master ]]; then - echo "📦 Publishing latest release!" - echo npm run release -- ${args} + script/release ${args} else echo "⚠️ This isn't a PR and '${TRAVIS_BRANCH}' isn't a release branch." exit 1 diff --git a/script/release b/script/release new file mode 100644 index 00000000..9ed06ae3 --- /dev/null +++ b/script/release @@ -0,0 +1,4 @@ +#!/bin/bash +set -e +echo "📦 Publishing latest release!" +echo lerna publish diff --git a/script/release-candidate b/script/release-candidate new file mode 100644 index 00000000..2c0129f3 --- /dev/null +++ b/script/release-candidate @@ -0,0 +1,4 @@ +#!/bin/bash +set -e +echo "👌 Publishing release candidate..." +echo lerna publish --npm-tag=rc From fbc5c29a66bb559ab0555379161fbbede0999bb9 Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Thu, 13 Jul 2017 16:15:55 -0700 Subject: [PATCH 22/24] chmod +x, duh --- script/release | 0 script/release-canary | 0 script/release-candidate | 0 3 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 script/release mode change 100644 => 100755 script/release-canary mode change 100644 => 100755 script/release-candidate diff --git a/script/release b/script/release old mode 100644 new mode 100755 diff --git a/script/release-canary b/script/release-canary old mode 100644 new mode 100755 diff --git a/script/release-candidate b/script/release-candidate old mode 100644 new mode 100755 From 8142e247f87d4124b7ca66bdac0735dca4889aa1 Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Thu, 13 Jul 2017 16:17:36 -0700 Subject: [PATCH 23/24] use "pr" npm dist-tag --- script/release-canary | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/script/release-canary b/script/release-canary index 286dff7a..c4dd4ebb 100755 --- a/script/release-canary +++ b/script/release-canary @@ -3,11 +3,12 @@ set -e args=${@:1} package=primer-css +npm_tag=pr # the commit status context -context=npm/publish/pr +context=npm/publish/${npm_tag} -echo "🐦 Publishing canary version..." -lerna publish --npm-tag=canary --canary --no-git ${args} +echo "🐦 Publishing canary version to dist-tag '${npm_tag}'..." +lerna publish --npm-tag=${npm_tag} --canary --no-git ${args} # get the canary version of primer-css from its package.json version=`jq -r .version modules/${package}/package.json` From cdf17a5bfb26757a86fbed13a2774521303885a4 Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Thu, 13 Jul 2017 16:36:27 -0700 Subject: [PATCH 24/24] rename release-canary => release-pr --- package.json | 2 +- script/cibuild | 4 ++-- script/{release-canary => release-pr} | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) rename script/{release-canary => release-pr} (83%) diff --git a/package.json b/package.json index f61e59c2..475fe8a0 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "clean": "lerna clean", "diff": "lerna diff", "updated": "lerna updated", - "release-canary": "script/release-canary", + "release-pr": "script/release-pr", "release-candidate": "script/release-candidate", "release": "script/release", "test": "lerna run test" diff --git a/script/cibuild b/script/cibuild index 6d197a4a..4a7310d1 100755 --- a/script/cibuild +++ b/script/cibuild @@ -5,9 +5,9 @@ set -e # which makes this easier to test locally args=${@:1} -# always publish a canary release if this is a PR build +# always publish a pr release if this is a PR build if [[ $TRAVIS_EVENT_TYPE = pull_request ]]; then - script/release-canary ${args} + script/release-pr ${args} # merges to dev build a release candidate elif [[ $TRAVIS_BRANCH = dev ]]; then script/release-candidate ${args} diff --git a/script/release-canary b/script/release-pr similarity index 83% rename from script/release-canary rename to script/release-pr index c4dd4ebb..e162f700 100755 --- a/script/release-canary +++ b/script/release-pr @@ -7,10 +7,10 @@ npm_tag=pr # the commit status context context=npm/publish/${npm_tag} -echo "🐦 Publishing canary version to dist-tag '${npm_tag}'..." +echo "🐦 Publishing PR release to dist-tag '${npm_tag}'..." lerna publish --npm-tag=${npm_tag} --canary --no-git ${args} -# get the canary version of primer-css from its package.json +# get the published version of primer-css from its package.json version=`jq -r .version modules/${package}/package.json` slug="${package}@${version}"