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

Use Travis for npm publishing #1538

Merged
merged 6 commits into from
Jan 14, 2017
Merged

Conversation

tivac
Copy link
Contributor

@tivac tivac commented Jan 14, 2017

New release process:

  1. Programmer enters npm version <type-of-change or new version> -m "v%s"

Everything else is fully automated, here's what will happen.

  1. Tests are run
  2. Linting is run (but doesn't fail build)
  3. Version number in package.json is incremented
  4. New bundles are generated using updated version
  5. git add called on bundle output
  6. package.json and updated bundles are committed to git
  7. previous commit is tagged using new version number
  8. git push --follow-tags pushes up new version commit & tag to github
  9. Travis sees new release, starts build
  10. Travis generates new bundles before running tests
  11. Travis runs tests
  12. Travis lints files (but can't fail build)
  13. If build fails, abort
  14. Build succeeded, so travis will commit back any changes to the repo (but there won't be any)
  15. Travis sees that this commit has a tag associated with it
  16. Travis will use the encrypted npm creds in .travis.yml to publish a new version to npm

😩 phew, that's a lot of work that a human never has to do again. This is basically the process I use to release most of the packages I maintain on npm and it's super nice to not really have to think about it. So long as you use npm version (the -m "v%s" isn't required but looks nicer as a tag name IMO) everything else just goes w/o much effort.

There's a little bit of duplicated effort between the local process and travis, it's mainly to ensure that the commit tagged v1.0.0-rc.8 actually points to the commit that bumped package.json and m.version in mithril.js/mithril.min.js to the new version. Otherwise there'd be a weird mismatch that I think people would find confusing.

@tivac tivac added 1.x labels Jan 14, 2017
@tivac tivac self-assigned this Jan 14, 2017
@tivac tivac added this to the 1.0 (Rewrite) milestone Jan 14, 2017
@tivac tivac merged commit 74c6b3e into MithrilJS:rewrite Jan 14, 2017
@tivac tivac deleted the travis-releasing branch January 14, 2017 04:10
@tivac
Copy link
Contributor Author

tivac commented Jan 14, 2017

Not quite working, since the build output didn't change it looks like Travis doesn't actually run the deploy task. Need to investigate further.

Here's the build that "worked" but stopped running, https://travis-ci.org/lhorie/mithril.js/builds/191845435

@tivac
Copy link
Contributor Author

tivac commented Jan 14, 2017

It was due to my "early out" calling exit 0 which ended the travis bash instance. Yikes, fixing.

@tivac
Copy link
Contributor Author

tivac commented Jan 14, 2017

@lhorie just a heads-up.

I believe this is fixed as of 59dfbf0, sorry about that. BASH scripting isn't something I have a ton of experience with so it takes a bit of flopping around usually.

I don't want to bump the version again & re-publish because both rc9 or rc8.1 would be ridiculous, especially given that there'd be no actual content change from rc8. I could unpublish rc8 since we're within the 24-hour window and try again but I don't think that is a great plan either.

So this code will just hang out, and we'll need to remember to use npm version when it comes time to cut a rc9.

@lhorie
Copy link
Member

lhorie commented Jan 14, 2017

Thanks @tivac

I think we should add the release process somewhere more official so we don't need to search back for this PR

@tivac
Copy link
Contributor Author

tivac commented Jan 14, 2017

Agreed, will document tonight. I think I can also have Travis amend the previous commit so I can remove the need for the locally built copy. Gonna play with that in another repo first though.

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

Successfully merging this pull request may close these issues.

2 participants