mozilla / fxa-email-service

DEPRECATED - Migrated to https://github.com/mozilla/fxa
Mozilla Public License 2.0
6 stars 6 forks source link

chore(package): create an automated release script #246

Closed philbooth closed 5 years ago

philbooth commented 5 years ago

Fixes #214.

Adds a shell script that automates most of the work involved in tagging releases. The only thing it doesn't do is git push, because a manual check that everything worked before publishing the tag is obviously a good thing.

The script has one slight advantage over what we're using elsewhere, in that the order of entries in the changelog will always be sane, even when we're tagging patch releases for older trains. That's because the step for updating the changelog inserts the summary immediately before the preceding tag, rather than always putting it at the top of the file regardless of where we are in the tree.

There are three other, small differences in the changelog:

These are all of the steps that the script performs, in order:

  1. Identify the last tag that precedes HEAD, assign it to LAST_TAG.

  2. Get the list of intervening one-line commit messages from git log $LAST_TAG..HEAD.

  3. Parse each commit message in turn, building up summary sections for the commit log. This includes an Other changes section for any commits that don't match one of the recrognised formats.

  4. Split $LAST_TAG and bump the appropriate part, then assemble the bumped tag as NEW_TAG.

  5. Update Cargo.toml and Cargo.lock with $NEW_TAG.

  6. Insert the summary for $NEW_TAG into the changelog, immediately before the summary for $OLD_TAG.

  7. Commit the changes.

  8. Tag the release.

Lastly, I wonder if some of you might be unhappy that we've written this ourselves rather than using a 3rd-party tool. I get where you're coming from, but fwiw this script is almost a verbatim copy (ref) of something I've been using in all my side-projects for the last couple of years. So it's reasonably battle-hardened at this point, although I'm sure there are still lots of exciting bugs for us to discover when we run it on different machines to mine. :grin:

@mozilla/fxa-devs r?