1
1
mirror of https://github.com/primer/css.git synced 2024-09-21 05:39:15 +03:00
css/script/cibuild
Shawn Allen c34ce15f07 move commit status notifications closer to publish
Previously, we were reporting pending publish status for whatever
package.json versions were in git. This moves the `notify pending` calls
right before the publish calls so that we can be sure we're always
reporting the version that will be published if it succeeds.
2017-07-25 11:35:52 -07:00

30 lines
782 B
Bash
Executable File

#!/bin/bash
set -e
# --yes gets passed in by .travis.yml,
# which makes this easier to test locally
args=$@
branch=$TRAVIS_BRANCH
if [[ "$TRAVIS_EVENT_TYPE" = "pull_request" ]]; then
target_branch=$TRAVIS_PULL_REQUEST_BRANCH
# if the *source* branch begins with "release"
if [[ "$branch" =~ ^release ]]; then
script/release-candidate $args
# otherwise, if the *target* branch is dev
elif [[ "$target_branch" = "dev" ]]; then
script/release-pr $args
else
echo "⚠️ This is a PR, but '$branch' isn't a release branch"
echo " and '$target_branch' isn't a recognized target branch."
exit 1
fi
elif [[ "$branch" = "master" ]]; then
script/release $args
else
echo "⚠️ This isn't a PR and '$branch' isn't a release branch."
exit 1
fi