Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Travis GitHub Releases #2555

Merged
merged 6 commits into from
Jun 28, 2016
Merged

Travis GitHub Releases #2555

merged 6 commits into from
Jun 28, 2016

Conversation

simonbrunel
Copy link
Member

@simonbrunel simonbrunel commented May 14, 2016

Update .travis.yml to build and upload dist/* files (and a ZIP archive) when a tag is created (proof of concept), then remove dist/* files from the repository. Also update links to the documentations and README.md.

The new release process would be:

  • draft a release (optional)
  • change the package.json version
  • create the associated git tag and push it on GitHub
  • a build is triggered by Travis for this tag (automatic)
  • generated dist/* files are uploaded along the release (automatic)
  • npm package is published to npmjs (automatic)

We will also need to update CDNjs to use these uploaded files.

The ZIP archive contains the following files:

/samples/**/*
/Chart.bundle.js
/Chart.bundle.min.js
/Chart.js
/Chart.min.js
/LICENSE.md

The release attached files will be:

Chart.bundle.js
Chart.bundle.min.js
Chart.js
Chart.min.js
Chart.js.zip
Source code (zip)
Source code (tar.gz)

See original PR #2550 & #2552 and issue #2554

@simonbrunel
Copy link
Member Author

simonbrunel commented May 14, 2016

@etimberg, @tannerlinsley: I wrote a gulp task to create a Chart.js.zip package, which one will be deployed by Travis. It's very similar to the current zip file containing the whole repository, but only for samples.

We could also provide only the Chart.js.zip file (no individual js files)?

Note: users who download the repo (source) would have to gulp build before using samples, which seems pretty normal, right?

@simonbrunel
Copy link
Member Author

simonbrunel commented May 15, 2016

Travis should now release the npm package automatically (2f28aed). When releasing a new version, we should updated the package.json version before pushing the new tag. I updated the PR description (release process).

@simonbrunel
Copy link
Member Author

simonbrunel commented May 15, 2016

Added the .npmignore, so hopefully the npm release should include exactly the same files as before. I'm thinking that now we might want to ignore more files for the npm package, what do you think?

@simonbrunel simonbrunel force-pushed the travis-dist branch 3 times, most recently from 6e43249 to 9ec7eba Compare May 29, 2016 15:01
@etimberg
Copy link
Member

etimberg commented Jun 4, 2016

Is there enough consensus to merge this?

@simonbrunel
Copy link
Member Author

@panzarino
Copy link
Contributor

+1

@simonbrunel simonbrunel force-pushed the travis-dist branch 4 times, most recently from 61747c9 to 80a695f Compare June 9, 2016 17:20
Travis now builds and deploys these files for all tags, so we don't need to have them on the repository anymore.
Remove outdated *standard build* and *bundled with Moment.js* links from the documentation and add a link to the latest GitHub release, from where the user can download `*.js` files.
Samples need to be packaged with built libraries (which one have been removed from the repository), so create a new `gulp package` task to generate a ZIP archive with dist files, samples and the license file. This archive is generated in the ./dist/ folder and will be deployed by Travis along the GH release. Note that the ./dist/ folder is not preserved but merged in the archive root. Also change samples requiring moment.js to load this lib from the CDN instead of the ./node_module folder.
Add .npmignore to include dist/*.js files to the npm release (but exclude zip files). See https://docs.travis-ci.com/user/deployment/npm/. Also cleanup the .gitignore file.
Remove the bower.json file and update the documentation with the alternative bower-npm-resolver solution.
@fulldecent
Copy link
Contributor

How can we confirm the API secure key works, or is there anything else we need to do to accept this PR?

Also, can you please provide documentation that pushing tags triggers a new Travis CI build?

@etimberg
Copy link
Member

@fulldecent we tried out a similar process in the color lib https://github.com/chartjs/chartjs-color/blob/master/.travis.yml

@panzarino
Copy link
Contributor

It definitely works, I would encourage a merge soon.

@etimberg
Copy link
Member

Yeah. I think we should merge this

@fulldecent
Copy link
Contributor

+1

@fulldecent
Copy link
Contributor

I just read up on the documentation at https://docs.travis-ci.com/user/deployment/releases on why this works. Ready to merge, perhaps one more set of eyes can look at this. @tannerlinsley @nnnick @simonbrunel @zachpanz88

@simonbrunel
Copy link
Member Author

@fulldecent: same process as Chart.Deferred.js, except for deploying to npm. I'm confident that everything will run smoothly, but if not, we can still publish manually until we adjust the process (I tried to keep commits well documented and consistent, please don't squash on merge).

The only missing part is CDNjs: we should update the package.json on their repo to reflect these changes before the next release. I don't think they support autoupdate from GitHub release files so it should now use npm release (which is the recommended method). I will prepare a PR if everyone is agree to merge that one.

@etimberg
Copy link
Member

Ok, let's merge this and then @simonbrunel can update CDNjs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants