The web3.js project follows the semver 2.0.0 specification.
The major
version has to be increased as soon as a breaking change is introduced. The definition of a breaking change is anything that requires a depending project to update their code base, build pipeline or tests.
The minor
is increased as soon as new smaller features do get introduced. A minor
release will not affect any depending project. Such a release only introduces smaller enhancements and features a project could use.
A patch release only contains required bug fixes with a low risk to impact depending project.
Further details about versioning can be found in the semver 2.0.0 specification we follow.
- The release should get released as an
legacy-dev
version on the specified track below. - The major
legacy-dev
version stays released for amonth
for testing purposes. - During release review, the code is frozen unless new changes are proposed, approved and merged.
i. Changes should trigger a new
legacy-dev
release and set the release clock back aweek
so reviewers have the time they need to test new changes.
The minor
release inherits the rules from the major
release but has a smaller testing phase of 3 days and the release clock will be set back 2 days
on a change of the published code.
Since November 2019, Web3 has been following the minor
rules for patch
as well, to help establish a series of non-breaking releases.
A Legacy-dev release gets published on the legacy-dev
track and is no longer under active development. A release candidate gets/Legacy-dev released with the version number defined in the semver 2.0.0 specification specification.
Because breaking changes are always happening during the development of a project it is required to define rules on how we inform depending projects about coming changes with enough time to react. This doesn't mean that we plan to introduce breaking changes but sometimes they are required.
- Deprecations will be announced in our
CHANGELOG
and in the description of a release. - Deprecated functionalities should be marked in the developer documentation, function documentation, and the related types as deprecated.
- A deprecated functionality stays deprecated for the next
X (TBD)
increases of the minor version.
The following describes the steps required to release a new version of web3.js
. It is followed to adhere to community standards and expectations.
As web3.js v4 published so everyone is requested to migrate to web3.js v4. Web3.js v1 will only get critical security updates and will follow tags:
- legacy
: for v1 main releases
- legacy-dev
: for v1 test/RC releases, this is replacement of rc
tag
git checkout 1.x
andgit pull
: Verify you are on the1.x
base branch.git checkout -b release/bumped-version
: Create release branch (e.g.release/1.10.4
).- In the project root, run
npm i
and commit changes using a commit message like:npm i for 1.10.4-dev.0
- Update and commit changes of
CHANGELOG.md
using a commit message like:changelog update for 1.10.4-dev.0
. 4.A. Add next anticipated release version in place of[Unreleased]
4.B. Move section header[Unreleased]
to bottom of file. - Bump package version and build lib using learna
lerna version 1.10.4-dev.0 --no-push --no-private --no-git-tag-version
- This will bump package version numbers, builds lib and minified file by invoking lifecycle scripts.
- Commit the version bump changes and builds in release branch created in
step 2
. git tag bumped-version
: Tag the commit with bumped version having prefixv
, e.g.git tag v1.0.1-dev.0
- Push release branch on github
git push origin release/1.2.7
. - Push release tag created in Step 7 to github
git push origin --tags
- Create a draft release on Github similar to this
- Select recently pushed tag in
choose a tag
drop down - Check
This is a pre-release
- Check
Create a discussion for this release
- In the release description, copy all entries in
CHANGELOG.md
for the version being released - Click
Save draft
- Select recently pushed tag in
- Create release PR (example).
- Ensure CI is green / passing. - Spend time here inspecting the CI logs to ensure everything looks valid and results were reported correctly.
- When sufficient approvals are given, publish draft release created in
Step 9
- Publish release on npm using
npm run publish from-package -- --dist-tag legacy-dev
.- Lerna can sometimes have difficulty with the number of packages we have. If the above command is unsuccessful, for every unpublished package run:
lerna publish --scope="package-name"
npm dist-tag add <package-name>@<version> legacy-dev
- Lerna can sometimes have difficulty with the number of packages we have. If the above command is unsuccessful, for every unpublished package run:
- Keep same PR open for formal release after few days based on rules defined in this document.
- Checkout release branch (e.g.
release/1.10.4
) created during legacy-dev releasestep 2
. - Verify all dependencies have been installed using
npm i
and commit changes.- If you are already in release branch dir, created for
legacy-dev
and no changes are made after it, you can skip step 1 and step 2
- If you are already in release branch dir, created for
- Build library and bump versions using:
lerna version 1.10.4 --force-publish --no-push --no-private --no-git-tag-version
- Commit all changes into release branch with commit message like
build for release 1.10.4
git tag bumped-version
: Tag the commit with bumped version having prefixv
, e.g.git tag v1.10.4
- Push release branch to origin
git push origin release/1.10.4
. - Push release tag created in
Step 5
toorigin
usinggit push origin --tags
- Publish the GitHub release.
- A GitHub Webhook should trigger the ReadTheDocs build after the release is published.
- (The build may sometimes need to be manually triggered in ReadTheDocs admin panel. If the version does not appear, create a build of a previous version to refresh the list.)
- Activate the new version.
- Set the version to default.
- Run
npm run publish from-package -- --dist-tag legacy
, it should belegacy
tag. - Merge release PR in
1.x
.