moment-timezone
moment-timezone copied to clipboard
Self-update the timezone data
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.
- 1 This would definitely be a good utility to add.
+1
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?
What would trigger it?
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?
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.
Oh, and don't forget publishing to all of the package repositories and CDNs.
@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?
I think the process, if triggered should be:
- get latest code for moment-timezone (i suppose on master branch)
- run
grunt data
- update version
- grunt build; grunt uglify; npm run test
- submit a PR to moment-timezone
- (human-checked) merge
- human - do a release of moment-timezone
- make a PR momentjs.com with latest moment-timezone package number
- 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.