1
1
mirror of https://github.com/primer/css.git synced 2024-11-30 11:17:05 +03:00
css/script/cibuild
2017-07-13 15:15:40 -07:00

29 lines
1006 B
Bash
Executable File

#!/bin/bash
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}"
# merges to dev build a release candidate
elif [[ $TRAVIS_BRANCH = dev ]]; then
echo "👌 Publishing release candidate..."
echo npm run 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}
else
echo "⚠️ This isn't a PR and '${TRAVIS_BRANCH}' isn't a release branch."
exit 1
fi