mirror of
https://github.com/primer/css.git
synced 2024-11-30 11:17:05 +03:00
rejigger cibuild logic for push builds only
This commit is contained in:
parent
d0d0e7d506
commit
71dad239ad
@ -5,41 +5,19 @@ set -e
|
|||||||
# which makes this easier to test locally
|
# which makes this easier to test locally
|
||||||
args=$@
|
args=$@
|
||||||
|
|
||||||
event="$TRAVIS_EVENT_TYPE"
|
branch=$TRAVIS_BRANCH
|
||||||
branch="$TRAVIS_BRANCH"
|
|
||||||
# use $TRAVIS_PULL_REQUEST_BRANCH if this is a PR
|
|
||||||
if [[ "$event" = "pull_request" ]]; then
|
|
||||||
branch="$TRAVIS_PULL_REQUEST_BRANCH"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "===== CI build ====="
|
if [[ "$TRAVIS_EVENT_TYPE" = "pull_request" ]]; then
|
||||||
echo " event: $event"
|
target_branch=$TRAVIS_PULL_REQUEST_BRANCH
|
||||||
echo " branch: $branch"
|
if [[ "$target_branch" =~ ^release ]]; then
|
||||||
echo "===================="
|
|
||||||
|
|
||||||
if [[ "$event" = "" || "$branch" = "" ]]; then
|
|
||||||
echo '❌ Missing $TRAVIS_EVENT_TYPE or $TRAVIS_BRANCH!'
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# release branches publish a release candidate
|
|
||||||
if [[ "$branch" =~ ^release- ]]; then
|
|
||||||
# only publish RCs for push builds
|
|
||||||
if [[ "$event" = "push" ]]; then
|
|
||||||
script/notify pending
|
script/notify pending
|
||||||
script/release-candidate $args
|
script/release-candidate $args
|
||||||
script/notify success
|
script/notify success
|
||||||
else
|
elif [[ "$target_branch" = "dev" ]]; then
|
||||||
echo "⚠️ This appears to be a release branch, but we only publish *push* builds."
|
script/notify pending
|
||||||
echo "(TRAVIS_EVENT_TYPE: $event)"
|
script/release-pr $args
|
||||||
exit 1
|
script/notify success
|
||||||
fi
|
fi
|
||||||
# always publish a pr release if this is a PR build
|
|
||||||
elif [[ "$event" = "pull_request" ]]; then
|
|
||||||
script/notify pending
|
|
||||||
script/release-pr $args
|
|
||||||
script/notify success
|
|
||||||
# publish a release when we merge to master
|
|
||||||
elif [[ "$branch" = "master" ]]; then
|
elif [[ "$branch" = "master" ]]; then
|
||||||
script/notify pending
|
script/notify pending
|
||||||
script/release $args
|
script/release $args
|
||||||
@ -48,4 +26,3 @@ else
|
|||||||
echo "⚠️ This isn't a PR and '$branch' isn't a release branch."
|
echo "⚠️ This isn't a PR and '$branch' isn't a release branch."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user