mirror of
https://github.com/primer/css.git
synced 2024-12-25 15:14:59 +03:00
27 lines
768 B
Bash
Executable File
27 lines
768 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
args=${@:1}
|
|
package=primer-css
|
|
npm_tag=pr
|
|
# the commit status context
|
|
context=npm/publish/${npm_tag}
|
|
|
|
echo "🐦 Publishing PR release to dist-tag '${npm_tag}'..."
|
|
lerna publish --npm-tag=${npm_tag} --canary --no-git ${args}
|
|
|
|
# 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
|