Skip to content

Commit

Permalink
Skip tweet during the release of a pre-release
Browse files Browse the repository at this point in the history
  • Loading branch information
kossnocorp committed Sep 14, 2017
1 parent e1a8b07 commit 9f1e4e7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Expand Up @@ -17,7 +17,6 @@ before_install:
branches:
only:
- master
- v2
- "/v\\d+\\.\\d+\\.\\d+(-\\w+)?/"

script:
Expand Down
15 changes: 13 additions & 2 deletions scripts/release/release.sh
Expand Up @@ -6,14 +6,22 @@

set -e

# A pre-release is a version with a label i.e. v2.0.0-alpha.1
if [[ "$TRAVIS_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+-.+$ ]]
then
IS_PRE_RELEASE=true
else
IS_PRE_RELEASE=false
fi

PACKAGE_PATH="$(pwd)/../../tmp/package"
./scripts/release/writeVersion.js

env PACKAGE_OUTPUT_PATH="$PACKAGE_PATH" ./scripts/build/package.sh

echo "//registry.npmjs.org/:_authToken=$NPM_KEY" > ~/.npmrc
cd "$PACKAGE_PATH" || exit 1
if [[ "$TRAVIS_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+-.+$ ]]
if [ "$IS_PRE_RELEASE" = true ]
then
npm publish --tag next
else
Expand All @@ -23,4 +31,7 @@ cd - || exit

./scripts/build/docs.js
./scripts/release/updateFirebase.js
./scripts/release/tweet.js # TODO: Skip tweet if it's a pre-release
if [ "$IS_PRE_RELEASE" = false ]
then
./scripts/release/tweet.js
fi

0 comments on commit 9f1e4e7

Please sign in to comment.