dojo/grunt-dojo2-extras

Add task to publish to npm

Opened this issue · 2 comments

As an engineer, it would be nice to have a way to instruct Travis automatically publish to npm or to publish locally using an automated process.

An automated publish could be triggered by committing to master w/ [npm-publish] in the commit message. The system would then validate the commit, check that version in package.json is valid and not marked w/ -pre, and that the version is not already published to npm.

The process would look something like this:

  • prompt for npm credentials (if running locally)
  • assert no changed files in git
  • check package.json's version
    • no -pre tag
    • version isn't already published on npm
    • new version is the latest version
  • publish to npm
  • a tag is added to git using the released version
  • the version in package.json is incremented and a -pre tag is added
  • the new package.json is committed and pushed w/ the tags
  • (optional) the commit information from the previous release is displayed (for release notes)
  • (optional) the new release is tagged using the GitHub APIs and the above commit information is used

NOTE: Doing a GitHub release requires OAuth credentials for GitHub, which would provide access to all repositories, so we may want to consider automating release notes as a separate feature.

might be worth looking at grunt-dojo2's release task, which we use for releasing our @dojo packages. it would be good to merge efforts and have one release tool. the current task is basic but it does the following (locally):

  • checks credentials for publishing
  • checks the branch is clean
  • versions by the dojo 2 versioning standards (git tags and npm)
  • publishes to npm
  • pushes back updated meta (package.json) to git remote if available
  • supports dry runs

This would be a nice to have (and daily publish) when we refactor our release process. Moving under that epic.