-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploy dist files and bower.json (tags)
Add a new Travis deploy task to push dist/*.js and bower.json files into tag sources: - requires Travis GITHUB_AUTH_TOKEN and GITHUB_AUTH_EMAIL environment variables - skipped if not built from the "release" branch - release.sh must be executable (see comment) - reads tag version from package.json - fails if tag already exists
- Loading branch information
1 parent
a12a737
commit 24b4db9
Showing
5 changed files
with
62 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
/dist | ||
/node_modules | ||
.DS_Store | ||
bower.json | ||
/.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
if [ "$TRAVIS_BRANCH" != "release" ]; then | ||
echo "Skipping release because this is not the 'release' branch" | ||
exit 0 | ||
fi | ||
|
||
# Travis executes this script from the repository root, so at the same level than package.json | ||
VERSION=$(node -p -e "require('./package.json').version") | ||
|
||
# Make sure that the associated tag doesn't already exist | ||
GITTAG=$(git ls-remote origin refs/tags/v$VERSION) | ||
if [ "$GITTAG" != "" ]; then | ||
echo "Tag for package.json version already exists, aborting release" | ||
exit 1 | ||
fi | ||
|
||
git remote add auth-origin https://$GITHUB_AUTH_TOKEN@github.com/$TRAVIS_REPO_SLUG.git | ||
git config --global user.email "$GITHUB_AUTH_EMAIL" | ||
git config --global user.name "Chart.js" | ||
git checkout --detach --quiet | ||
git add -f dist/*.js bower.json | ||
git commit -m "Release $VERSION" | ||
git tag -a "v$VERSION" -m "Version $VERSION" | ||
git push -q auth-origin refs/tags/v$VERSION 2>/dev/null | ||
git remote rm auth-origin | ||
git checkout -f @{-1} |