Skip to content

Commit

Permalink
Merge pull request #669 from dcbrwn/master
Browse files Browse the repository at this point in the history
Publish built versions to epoberezkin/ajv-dist
  • Loading branch information
epoberezkin committed Jan 26, 2018
2 parents 1f75c51 + 2c83055 commit 5a81409
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -11,6 +11,7 @@ after_script:
- codeclimate-test-reporter < coverage/lcov.info
- coveralls < coverage/lcov.info
- scripts/travis-gh-pages
- scripts/publish-built-version
notifications:
webhooks:
urls:
Expand Down
31 changes: 31 additions & 0 deletions scripts/publish-built-version
@@ -0,0 +1,31 @@
#!/usr/bin/env bash

set -e

if [[ -n $TRAVIS_TAG && $TRAVIS_JOB_NUMBER =~ ".3" ]]; then
echo "About to publish $TRAVIS_TAG to ajv-dist..."

git config user.email "$GIT_USER_EMAIL"
git config user.name "$GIT_USER_NAME"

git clone https://${GITHUB_TOKEN}@github.com/epoberezkin/ajv-dist.git ../ajv-dist

mkdir -p ../ajv-dist/dist
cp ./dist/* ../ajv-dist/dist
cp ./bower.json ../ajv-dist
cd ../ajv-dist

if [[ `git status --porcelain` ]]; then
echo "Changes detected. Updating master branch..."
git add -A
git commit -m "updated by travis build #$TRAVIS_BUILD_NUMBER"
git push --quiet origin master > /dev/null 2>&1
fi

echo "Publishing tag..."

git tag $TRAVIS_TAG
git push --tags > /dev/null 2>&1

echo "Done"
fi

0 comments on commit 5a81409

Please sign in to comment.