Skip to content

Instantly share code, notes, and snippets.

@marwahaha
Last active December 13, 2018 06:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marwahaha/44deb629e81fbf02c599074ffc8a9c46 to your computer and use it in GitHub Desktop.
Save marwahaha/44deb629e81fbf02c599074ffc8a9c46 to your computer and use it in GitHub Desktop.
Moment release process
  1. Make sure there are no unmerged PRs or unresolved critical bugs that should be part of the release

All changes should be squash-merged to develop at this point.

The commit description is the PR title. What makes a good Pull Request title?

  • It should start with an identifier, i.e. [bugfix]
  • It has meaningful text describing the code change
  • If applicable, it references a ticket, i.e. (fixes #23)
  1. Run tests on sauce.

As of 2017.11.20, some of the Windows 7 tests and IE8 tests are flaky, we need to investigate.

grunt test:browser
grunt test:sauce-browser ## todo - this is not working right now!
git checkout .
git clean -f

Make sure you have a Saucelabs account, and get the open-source plan (you have to email them directly).

  1. Make sure tests pass inside momentjs.com, locally (using latest moment-timezone). Update moment-timezone if necessary.

Symlink [moment, moment-timezone] to [libs/moment, libs/moment-timezone] of the momentjs.com repository.

cd libs/moment
git checkout origin/develop
npm install
grunt release
cd ../moment-timezone
git fetch origin
git checkout origin/master
cd ../..
grunt server

Make sure you check the moment tests and cursorily check the moment-timezone tests.

  1. Go through the commit history and make a changelog. Each item should have the PR that was merged, or at least a commit hash. Publish the changelog in a gist (like https://gist.github.com/ichernev/ac3899324a5fa6c8c9b4). Make sure breaking changes are highly visible.

We have a script to do this! Go to the root of your moment repository:

curl https://gist.githubusercontent.com/marwahaha/deb752493230f4785d32562d7aed8493/raw/ > moment-gist.py
python moment-gist.py 2.19.2 2.19.3
  1. Update momentjs.com -- add documentation about new features and deprecations. Use grunt server and develop on localhost. Make sure typings are updated with new functions/params.

When adding to docs, tasks/fix-order.js can fix the numberings for each section.

  1. Update CHANGELOG.md with a shorter summary of the changelog, and point to the gist. Update Moment.js.nuspec <releaseNotes>. Commit with message Update changelog for 1.2.3.

Before you commit, make sure you've removed changes from grunt release. Only commit those two changes.

  1. Bump version with grunt bump_version:1.2.3, commit Bump version to 1.2.3

Double-check that the version changed in all places, including Meteor, Nuspec, and package.json

  1. Run grunt release to build all files that need building. Commit with message Build 1.2.3

This is the last local step. If you push now, you have to finish the release process.

  1. Push develop (not yet released) moment github repo.
  2. Update moment reference in momentjs.com libs/moment, and make sure the references to the new version are working (on localhost)
  3. Check if the develop travis built is successful
  4. Merge develop into master, tag and push
git checkout master
git merge develop
git tag 2.19.2 -m 2.19.2
git push && git push --tags
  1. Pre-publish on NPM. This makes a fresh clone and whitelist to control what gets published.
./scripts/npm_prepublish.sh 1.2.3
cd ../moment-npm
npm publish
cd -
  1. Update momentjs.com moment dependency in package.json, commit and push, travis will deploy the website. (make sure it updates!)
  2. Nuget publish grunt nuget-publish (usually this doesn't work, so I also run nuget push Moment.js.2.19.2.nupkg -Source https://api.nuget.org/v3/index.json, more info here)
  3. Meteor publish meteor login && cd meteor && meteor publish && cd -
  4. Advertise: tweet about the new release passing a link to the extended changelog (in the gist).
@marwahaha
Copy link
Author

Also make sure the package-lock.json gets updated!

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