Add release script supporting multiple module repo

Issue: #100 (closed)

This MR adds a /scripts/release.sh script properly handling releases for both the v1 and v2 module

Ex usage:

> LATEST_TAG_OVERRIDE=v2/v2.0.0 ./scripts/release.sh v2 --dry-run 
Found latest release tag: v2/v2.0.0
Found 10 unreleased commit(s) for module v2.

=== Changelog Preview ===
## 2.1.0

### Features

- feat: Add new deprecations (`ca8ec851`)
- feat: update field constants from labkit-spec v1.0 (`154b4923`)

### Bug Fixes

- fix: add final //nolint:errcheck comments for multiline fmt calls (`202c0834`)
- fix: add remaining //nolint:errcheck comments (`2a57284e`)
- fix: add //nolint:errcheck to deliberately ignored errors in tests/examples (`e8e1cfaf`)
- fix: handle errors idiomatically in examples and tests (`51a2a4b8`)

=========================

Dry run: would create tag 'v2/v2.1.0' and a GitLab release.
  • Collect commits since latest tag, filtered for commits touching relevant module (Pathspec v2/ or :(exclude)v2/)
  • Determine appropriate SemVer to bump to based on conventional commit messages
  • Tag and push appropriate release version
  • Create a Gitlab release with a changelog, including feats and fixes relevant only to the specified module

Notes:

  • To allow us to stay on v1.X.X and v2/2.X.X this script will never perform a major version release
  • Commits with conventional commit type feat will trigger a minor release
  • Commits with conventional commit type fix will trigger a patch release

Limitations:

  • Release triggering commits outside of v2 will trigger a v1 release. (Ex. A feat commit touching README.md will trigger a v1 release.)

Testing:

Next Steps:

  • This MR adds the script, but does not hook it up in CI. Developers can checkout master and cut releases for both modules manually.

Following up this MR, I plan on:

  • Disabling our previous release jobs
  • Removing tags for the incorrect releases we've accidentally cut (Will confirm with team before doing so. Slack ref)
  • Add two CI jobs, running this script for v1 and v2 on commits to master.
  • Update contribution / release docs
Edited by Luke Hollinda

Merge request reports

Loading
Loading