mirror of
https://github.com/primer/css.git
synced 2025-01-06 22:36:48 +03:00
c34ce15f07
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.
30 lines
782 B
Bash
Executable File
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
|
|
|