-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3223 from simonbrunel/bower_release
Deploy dist files in release tags (bower support)
- Loading branch information
Showing
7 changed files
with
103 additions
and
74 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 |
---|---|---|
|
@@ -6,3 +6,4 @@ | |
|
||
.DS_Store | ||
.idea | ||
bower.json |
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,36 @@ | ||
# Maintaining | ||
## Release Process | ||
Chart.js relies on [Travis CI](https://travis-ci.org/) to automate the library [releases](https://github.com/chartjs/Chart.js/releases). | ||
|
||
### Releasing a New Version | ||
|
||
1. draft release notes on [GitHub](https://github.com/chartjs/Chart.js/releases/new) for the upcoming tag | ||
1. update `master` `package.json` version using [semver](http://semver.org/) semantic | ||
1. merge `master` into the `release` branch | ||
1. follow the build process on [Travis CI](https://travis-ci.org/chartjs/Chart.js) | ||
|
||
> **Note:** if `master` is merged in `release` with a `package.json` version that already exists, the tag | ||
creation fails and the release process is aborted. | ||
|
||
### Automated Tasks | ||
Merging into the `release` branch kicks off the automated release process: | ||
|
||
* build of the `dist/*.js` files | ||
* `bower.json` is generated from `package.json` | ||
* `dist/*.js` and `bower.json` are added to a detached branch | ||
* a tag is created from the `package.json` version | ||
* tag (with dist files) is pushed to GitHub | ||
|
||
Creation of this tag triggers a new build: | ||
|
||
* `Chart.js.zip` package is generated, containing dist files and examples | ||
* `dist/*.js` and `Chart.js.zip` are attached to the GitHub release (downloads) | ||
* a new npm package is published on [npmjs](https://www.npmjs.com/package/chart.js) | ||
|
||
Finally, [cdnjs](https://cdnjs.com/libraries/Chart.js) is automatically updated from the npm release. | ||
|
||
### Further Reading | ||
|
||
* [Travis GitHub releases](/chartjs/Chart.js/pull/2555) | ||
* [Bower support and dist/* files](/chartjs/Chart.js/issues/3033) | ||
* [cdnjs npm auto update](/cdnjs/cdnjs/pull/8401) |
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} |