1
1
mirror of https://github.com/primer/css.git synced 2024-11-13 08:04:16 +03:00
css/script/cibuild

22 lines
637 B
Plaintext
Raw Normal View History

2017-07-08 05:59:11 +03:00
#!/bin/bash
2017-07-08 01:57:33 +03:00
set -e
2017-07-08 02:00:22 +03:00
2017-07-11 23:09:43 +03:00
args=${@:1}
2017-07-11 01:48:41 +03:00
2017-07-08 01:57:33 +03:00
# always publish a canary release if this is a PR build
2017-07-08 06:04:01 +03:00
if [[ $TRAVIS_EVENT_TYPE = pull_request ]]; then
2017-07-08 02:00:22 +03:00
echo "🐦 Publishing canary version..."
2017-07-11 23:09:43 +03:00
npm run release-canary -- ${args}
2017-07-08 01:57:33 +03:00
# merges to dev build a release candidate
2017-07-11 01:48:41 +03:00
elif [[ $TRAVIS_BRANCH = dev ]]; then
2017-07-08 01:57:33 +03:00
echo "👌 Publishing release candidate..."
2017-07-11 23:09:43 +03:00
npm run release-candidate -- ${args}
2017-07-11 01:48:41 +03:00
# publish a release when we merge to master
2017-07-08 01:57:33 +03:00
elif [[ $TRAVIS_BRANCH = master ]]; then
echo "📦 Publishing latest release!"
2017-07-11 23:09:43 +03:00
npm run release -- ${args}
2017-07-08 01:57:33 +03:00
else
echo "⚠️ This isn't a PR and '${TRAVIS_BRANCH}' isn't a release branch."
exit 1
fi