1
1
mirror of https://github.com/primer/css.git synced 2024-12-21 05:01:45 +03:00
css/script/release-pr

27 lines
768 B
Plaintext
Raw Normal View History

#!/bin/bash
set -e
args=${@:1}
package=primer-css
2017-07-14 02:17:36 +03:00
npm_tag=pr
# the commit status context
2017-07-14 02:17:36 +03:00
context=npm/publish/${npm_tag}
2017-07-14 02:36:27 +03:00
echo "🐦 Publishing PR release to dist-tag '${npm_tag}'..."
2017-07-14 02:17:36 +03:00
lerna publish --npm-tag=${npm_tag} --canary --no-git ${args}
2017-07-14 02:36:27 +03:00
# get the published 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