This checklist walks you through releasing a stable version. See below for the checklist for release candidates.
We'll use v4.6.0 as the intended release version as a running example.
./releases_drafts/ on the releases/v4.6.0 branch, then the release notes are not done. (See the section “Writing the release notes”.)git checkout releases/v4.6.0 (This branch should already exist, from the release candidates.)git pullsrc/CMakeLists.txt, verify you seeset(LEAN_VERSION_MINOR 6) (for whichever 6 is appropriate)set(LEAN_VERSION_IS_RELEASE 1)git tag v4.6.0git push $REMOTE v4.6.0, where $REMOTE is the upstream Lean repository (e.g., origin, upstream)https://github.com/leanprover/lean4/actions/workflows/ci.yml, looking for the v4.6.0 tag.v4.6.0 release appears.RELEASES.md section. Do a quick sanity check.master/main changing the toolchain to v4.6.0main or master, don’t change this; you've just updated the dependency, so it will work and be saved in the manifestlake updatev4.6.0 from master/main and push it.v4.6.0 into the stable branch and push it.stablestableBatteriesProofWidgets uses a sequential version tagging scheme, e.g. v0.0.29, which does not refer to the toolchain being used.ProofWidgets does not maintain a stable branch.Batteriesstablestable branch; skip this stepSubVerso dependency should be compatible with every Lean release simultaneously, rather than following this workflowstable branch; skip this stepstable branch; skip this stepAesop, ProofWidgets4, lean4checker, Batteries, doc-gen4, import-graphlean-toolchain and lakefile.lean, in .github/workflows/lean4checker.yml update the line git checkout v4.6.0 to the appropriate tag.stable. Coordinate with a Mathlib maintainer to get this merged.Mathlib (for test code)lean-toolchain/lakefile.lean: in the root, and in test/Mathlib/. Edit both, and run lake update in both directories.stablev4.6.0 section of RELEASES.md is out of sync between releases/v4.6.0 and master. This should be reconciled:v4.6.0 section on master with the v4.6.0 section on releases/v4.6.0 and commit this to master.v4.6.0. Please see previous announcements for suggested language. You will want a few bullet points for main topics from the release notes. Link to the blog post from the Zulip announcement.This checklist walks you through creating the first release candidate for a version of Lean.
We'll use v4.7.0-rc1 as the intended release version in this example.
nightly-2024-02-29 in this example.bump/v4.7.0 branch contain nightly-2024-02-29 in their lean-toolchain.git remote add nightly https://github.com/leanprover/lean4-nightly.git git fetch nightly tag nightly-2024-02-29 git checkout nightly-2024-02-29 git checkout -b releases/v4.7.0
RELEASES.md replace Development in progress in the v4.7.0 section with Release notes to be written.src/CMakeLists.txt,set(LEAN_VERSION_MINOR 7) (for whichever 7 is appropriate); this should already have been updated when the development cycle began.set(LEAN_VERSION_IS_RELEASE 1) (this should be a change; on master and nightly releases it is always 0).src/CMakeLists.txt, and push.git tag v4.7.0-rc1git push origin v4.7.0-rc1https://github.com/leanprover/lean4/actions/workflows/ci.yml, looking for the v4.7.0-rc1 tag.v4.6.0, and click “Generate release notes”. This will add a list of all the commits since the last stable version.bump/v4.7.0 containing the required adaptations. The preparation of this branch is beyond the scope of this document.bump/v4.7.0 does not exist) then create a new PR updating lean-toolchain to leanprover/lean4:v4.7.0-rc1 and running lake update.bump/v4.7.0 branch.lean-toolchain is set to the nightly from which the release candidate was created.git merge origin/masterlean-toolchain to leanprover/lean4:v4.7.0-rc1lakefile.lean, change any dependencies which were using nightly-testing or bump/v4.7.0 branches back to master or main, and run lake update for those dependencies.lake build to ensure that dependencies are found (but it's okay to stop it after a moment).git commitgit pushbump/v4.7.0 to master, and either merge it yourself after CI, if appropriate, or notify the maintainers that it is ready to go.master with v4.7.0-rc1 and push this tag.bump/v4.7.0 PRs yourself! It is essential for Mathlib CI that you then create the next bump/v4.8.0 branch for the next development cycle. Set the lean-toolchain file on this branch to same nightly you used for this release.nightly-testing branch, make sure there is a tag nightly-testing-2024-02-29 with date corresponding to the nightly used for the release (create it if not), and then on the nightly-testing branch git reset --hard master, and force push.v4.7.0-rc1. Please see previous announcements for suggested language. You will want a few bullet points for main topics from the release notes. Please also make sure that whoever is handling social media knows the release is out.v4.8.0) on the Lean repository, by making a PR that:src/CMakeLists.txt to say set(LEAN_VERSION_MINOR 8)v4.6.0 section of RELEASES.md with the finalized release notes from the releases/v4.6.0 branch.v4.7.0 section of RELEASES.md withRelease candidate, release notes will be copied from the branch `releases/v4.7.0` once completed.and inserts the following section before that section:
v4.8.0 ---------- Development in progress.
./releases_drafts/ folder.Slightly longer than the corresponding steps for a stable release. Similar process, but more things go wrong. In particular, updating the downstream repositories is significantly more work (because we need to merge existing bump/v4.7.0 branches, not just update a toolchain).
bump/v4.7.0 branchesWhile not part of the release process per se, this is a brief summary of the work that goes into updating Batteries/Aesop/Mathlib to new versions.
Please read https://leanprover-community.github.io/contribute/tags_and_branches.html
nightly-testing branch that receives commits automatically from master, and has its toolchain updated automatically for every nightly. (Note: the aesop branch is not automated, and is updated on an as needed basis.) As a consequence this branch is often broken. A bot posts in the (private!) “Mathlib reviewers” stream on Zulip about the status of these branches.nightly-testing: there is no PR process.bump/v4.7.0 which accumulates reviewed changes adapting to new versions.nightly-testing is working on a given nightly, say nightly-2024-02-15, we will create a PR to bump/v4.7.0.scripts/create-adaptation-pr.sh that automates this process.bump/v4.7.0 is up to date with master (by merging master, no PR necessary)bump/v4.7.0 a bump/nightly-2024-02-15 branch.git merge nightly-testing to bring across changes from nightly-testing.bump/v4.7.0 from the bump/nightly-2024-02-15 branch.bump/v4.7.0.master -> bump/v4.7.0 -> bump/nightly-2024-02-15 -> nightly-testing. Please remember to push any merges you make to intermediate steps!We are currently trying a system where release notes are compiled all at once from someone looking through the commit history. The exact steps are a work in progress. Here is the general idea:
releases/v4.6.0 branch sometime after it is created but before the stable release is made. The release notes for v4.6.0 will later be copied to master when we begin a new development cycle../releases_drafts, which should be all incorporated in the release notes and then deleted from the branch. See ./releases_drafts/README.md for more information.This section will be updated when the next release notes are written (for v4.10.0).