1
1
mirror of https://github.com/primer/css.git synced 2024-11-24 05:06:04 +03:00

isolate release-canary script for easier testing

This commit is contained in:
Shawn Allen 2017-07-13 16:09:47 -07:00
parent 583f65093b
commit d8e4ddaf3d
2 changed files with 26 additions and 7 deletions

View File

@ -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..."

25
script/release-canary Normal file
View File

@ -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:
# <https://github.com/taskworld/commit-status/issues/5>
TRAVIS_COMMIT=$TRAVIS_PULL_REQUEST_SHA \
commit-status success ${context} \
"npm install ${slug}" \
"https://unpkg.com/${slug}/build/build.css"
fi