moment-timezone icon indicating copy to clipboard operation
moment-timezone copied to clipboard

Self-update the timezone data

Open mattjohnsonpint opened this issue 9 years ago • 9 comments

It should be fairly easy to build a bot that will run the following daily:

  • Check the current release of tzdb from IANA to see if its more current than we're hosting
  • If it's updated, download, install, and compile moment-timezone data files
  • Send a PR to GitHub to update the website.

That will remove the need for someone to manually build the data file with each release. We'd then simply merge the PR via GitHub.

This would reduce the likelyhood of error in compiling the script, and still give us the ability to review changes.

mattjohnsonpint avatar Apr 08 '15 16:04 mattjohnsonpint

  • 1 This would definitely be a good utility to add.

kashifshamaz21 avatar Apr 08 '15 17:04 kashifshamaz21

+1

markudevelop avatar Aug 07 '15 06:08 markudevelop

This sounds like a job for a CI-server, maybe? You already have a CI build on Travis-CI for moment.js, why not add a job for this as an automation? I'm thinking something like this: https://gist.github.com/domenic/ec8b0fc8ab45f39403dd only creating a pull request to momentjs.com instead of pushing the gh-pages directly.

If you like the idea, I could give it a try, but I would like a little discussion about the details first.

How about it @mj1856?

joelmheim avatar Oct 18 '15 21:10 joelmheim

What would trigger it?

mattjohnsonpint avatar Oct 18 '15 22:10 mattjohnsonpint

There are ways of triggering Travis-CI periodically, for instance: https://nightli.es/ or http://traviscron.pythonanywhere.com/

Unfortunately the Travis guys are not planning to support this natively in the foreseeable future.

Could you walk me through the manual workflow? Or is this already documented somewhere that I just haven't been able to find?

joelmheim avatar Oct 19 '15 08:10 joelmheim

There are instructions in the moment-timezone contributing guide. Though I've done it a couple of times and gotten it wrong somehow. Usually @timrwood does these.

The other pain is that even after doing the update, we still have to wait for a release build, and a build of the momentjs.com website. It is frustrating that we don't have good CI triggers to build and deploy on check-in.

mattjohnsonpint avatar Oct 20 '15 16:10 mattjohnsonpint

Oh, and don't forget publishing to all of the package repositories and CDNs.

mattjohnsonpint avatar Oct 20 '15 16:10 mattjohnsonpint

@mj1856 This seems like it'd be a really good fit for Github Actions. Would you be happy to sign https://github.com/moment/moment-timezone up for the beta so I could give it a go?

camillef avatar Oct 17 '19 17:10 camillef

I think the process, if triggered should be:

  1. get latest code for moment-timezone (i suppose on master branch)
  2. run grunt data
  3. update version
  4. grunt build; grunt uglify; npm run test
  5. submit a PR to moment-timezone
  6. (human-checked) merge
  7. human - do a release of moment-timezone
  8. make a PR momentjs.com with latest moment-timezone package number
  9. merge PR

The first half is documented here: https://github.com/moment/moment-timezone/blob/develop/contributing.md#steps-to-release-a-new-version

I think this should be handled within moment-timzeone, if at all. I'd be ok with a robot reminding us with an issue every time IANA releases a new version.

marwahaha avatar May 20 '20 01:05 marwahaha