For maintainers only.
This document explains what are the necessary steps to draft a new release and publish it on NPM and GitHub.
Middy is managed as a monorepo. This means that Middy core package and all the official middlewares are developed using the same repository.
By design, new releases keeps all the package versions in sync. For instance, if we are to release v1.2.3, this means that EVERY package needs to be bumped to v1.2.3 and that EVERY package will be published.
This particular design has few important implications:
- Every time a new version is released, all the packages are version bumped (to the same version), regardless if a given package was subject to change or not.
- This gives the users the confidence that dependent packages are always tested together and that, in a given project using middy, they can all be easily version bumped all together. The goal is to avoid the users the hassle to having to deal with complex compatibility matrices.
At a given point in time, if you want to draft a new release, you need to follow a specific sequence of actions, as described in the following sections:
- Versioning should follow semantic versioning which, in short, means:
- Versions numbers use the format
X.Y.ZwhereXis called "major", Y is called "minor" andZis called "patch". - If the new releases fixes bugs in a backward compatible way, only the "patch" fragment should be bumped.
- If you are adding a new feature in a backward compatible way, "minor" should be bumped and "patch" should be reset to
0. - If you are providing any breaking change, you should bump "major" and reset to
0both "minor" and "patch". - You can optionally have suffixes such as
-alphaor-betafor pre-releases of upcoming major versions. - If you need to have multiple versions of pre-releases, those should have a
.Xsuffix, whereXis an increasing number (e.g.1.0.0-beta.15).
- Versions numbers use the format
- Releases should always be done from the
masterbranch (unless working on a future/past major version branch like0.xor2.0). - You can create a
release-vX.Y.Zbranch if you want to do all the necessary changes in multiple commits and/or if you wish to have a review from the other maintainers
- Update the
versionfield of the mainpackage.jsonwith the new version. - Run the command
npm run syncto make sure every package will have the same version. - Commit all the changes so far.
- If you have been working on a branch so far, make sure the branch is merged back to master (or its own version branch in case of future/past major versions).
- Create a new release on GitHub, with the following attributes:
- Tag version:
X.Y.Zas per the target version. Note: don't use avprefix for the version. - Release title: same as above
- Release description: summarize the changes in the new version
- Tag version:
- Publish release
This step will happen automatically from GitHub actions after a new release has been drafted. Make sure to double check the action and see if it completed successfully.
All packages are published using OpenID Connect. Each new package must be configured first.
Organization or user* middyjs Repository* middy Workflow filename* release.yml Publishing access Require two-factor authentication and disallow tokens (recommended)
package.json- Update
enginesversions - Add
--dist-tag nexttopublishscript
- Update
- Update
build.ymlandtests.ymlto use current AWS lambda nodejs runtimes