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

43 lines
999 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
# --yes gets passed in by .travis.yml,
# which makes this easier to test locally
args=$@
2017-07-11 01:48:41 +03:00
event=$TRAVIS_EVENT_TYPE
if [[ $event = "pull_request" ]]; then
branch=$TRAVIS_PULL_REQUEST_BRANCH
else
branch=$TRAVIS_BRANCH
fi
echo "==== CI env ===="
echo "event: $event"
echo "branch: $branch"
echo "================"
2017-07-21 02:49:22 +03:00
# release branches publish a release candidate
if [[ $branch =~ "^release-" ]]; then
# only publish RCs for push builds
if [[ $event = "push" ]]; then
script/notify pending
script/release-candidate $args
script/notify success
fi
2017-07-14 02:36:27 +03:00
# always publish a pr release if this is a PR build
elif [[ $event = "pull_request" ]]; then
script/notify pending
2017-07-21 01:21:59 +03:00
script/release-pr $args
script/notify success
2017-07-11 01:48:41 +03:00
# publish a release when we merge to master
elif [[ $branch = "master" ]]; then
script/notify pending
2017-07-21 01:21:59 +03:00
script/release $args
script/notify success
2017-07-08 01:57:33 +03:00
else
2017-07-21 01:21:59 +03:00
echo "⚠️ This isn't a PR and '$TRAVIS_BRANCH' isn't a release branch."
2017-07-08 01:57:33 +03:00
exit 1
fi
2017-07-21 01:21:59 +03:00