Releases¶
To do - Simplify the branch or version structure
Just release from the master branch (but keep the stable branch
tracking the latest stable release plus updates to documentation).
Version scheme¶
A Stack package or executable may have a version with three or four components:
X.Y.Z or X.Y.Z.A.
Development or stable versions¶
- Versions with an even
Ycomponent are development versions (themasterbranch) - Versions with an odd
Ycomponent are stable versions (thestablebranch, or in arc/vX.Yrelease candidate branch for not-yet-released versions)
Unreleased or released versions¶
- Versions with an even
Zcomponent are unreleased versions (including release candidates) - Versions with an odd
Zcomponent are released versions - Except for the
releasebranch (which matches exactly the most recent release), all branches must have an evenZcomponent - Branches other than
stable,release, and arc/vX.Yrelease candidate will always have a0Zcomponent
Use of a fourth component¶
- Release candidate binaries will be released with an odd
Acomponent - Hackage-only dependency compatibility patch releases add a
Acomponent (e.g.v2.5.5.1, in thereleasebranch) - Pre-release unstable binaries will be released with the date as the
Acomponent (e.g.2.14.0.20240126)
Examples:
2.15.0.0:v2.15.xseries pre-release branch (rc/v2.15branch)2.15.0.1: first release candidate for first release ofv2.15.xseries (rc/v2.15branch)2.15.0.2: continuing development on pre-release branch2.15.0.3: second release candidate for first release ofv2.15.xseries (rc/v2.15branch)2.15.1: first release of the2.15.xseries (releasebranch)2.15.2: development for second release of2.15.xseries (stablebranch)2.15.2.1: first release candidate for second release of2.15.xseries (rc/v2.15branch)2.15.3: second release of2.15.xseries (releasebranch)2.15.3.1: first Hackage-only patch of2.15.3(releasebranch)2.15.3.2: second Hackage-only patch of2.15.3(releasebranch)2.14.0: unstable development code (masterbranch)2.14.0.20240126: pre-release snapshot of unstable version (masterbranch)
Pre-release checks¶
-
Check for any P0 and P1 issues that should be dealt with before release.
-
Check for un-merged pull requests that should be merged before release.
-
Ensure the
releaseandstablebranches are merged to themasterbranch. -
Check the copyright dates, and update if needed.
-
Check the backwards compatability section of
CONTRIBUTING.mdis up to date. -
Ensure CI matrices in docs (travis-complex, appveyor, azure) have current stackage snapshots and GHC versions (e.g. https://github.com/commercialhaskell/stack/pull/4565/files)
-
Update any
stack-*.yamlthat uses anightlysnapshot to the latest nightly (go over the extra-deps too) and ensure the project builds and tests pass. For example, command: -
The Windows installer is built using an NSIS compiler. Check that the NSIS compiler that will be used is capable of handling large strings.
-
Ensure the integration tests pass on Linux, macOS and Windows.
-
Some people prefer, or need, to build Stack with Cabal (the tool). Check that
cabal.projectis up to date (the specifiedwith-compiler:). Check thatcabal.configis up to date and is not missing dependencies relevant on Windows and non-Windows operating systems, following the instructions incabal.project.
Release preparation¶
A: In the master branch¶
-
package.yaml: bump to the next release candidate version (bump the second component to the next odd number, ensure the third component is0, and add patchlevel0; e.g. from2.14.0to2.15.0.0).Attention
Be sure to update also
stack.cabal(for example by usingstack build --dry-run). -
ChangeLog.md: Check for any entries that snuck into the previous version's changes due to merges (git diff origin/stable HEAD ChangeLog.md)
B: Create a new release candidate branch¶
Cut a new release candidate (RC) branch named rc/vX.Y from the master
branch.
C: Return to the master branch¶
-
package.yaml: bump version to the next unstable version (bump the second component to the next even number, ensure the third component is0; e.g. from2.15.0to2.16.0).Attention
Be sure to update also
stack.cabal(for example by usingstack build --dry-run). -
Changelog.md:- Change the title of the existing Unreleased changes section to what
will be the next final (non-RC) release (e.g.
v2.15.1). -
Add new "Unreleased changes" section:
- Change the title of the existing Unreleased changes section to what
will be the next final (non-RC) release (e.g.
-
cabal.config: Ensure thestackconstraint is set to the same version as in thepackage.yaml.
D: In the release candidate branch¶
-
Review documentation for any changes that need to be made:
- Ensure all the documentation pages are listed in the
mkdocs.yamlfile. Usegit diff --stat origin/stable..HEAD doc/to look for new or deleted files. - Any new documentation pages should have the "may not be correct for the released version of Stack" warning at the top.
-
Search for old Stack version, unstable Stack version, and the next "obvious" possible versions in sequence, and
UNRELEASEDand replace with next release version (X.Y.1, where Y is odd).Attention
Do NOT update the repository's issue and pull request templates (in the
.githubdirectory) to point at the new release version yet! -
Search for old snapshots, set to latest snapshot (e.g. in
doc/GUIDE.mdwhere it references the "currently the latest LTS") - Look for any links to "latest" (
latest/) documentation, replace with version tag
- Ensure all the documentation pages are listed in the
-
Check for any platform entries that need to be added to (or removed from):
- releases.yaml,
- install_and_upgrade.md,
- get-stack.sh,
- doc/README.md, and
get.haskellstack.orgredirects.
-
Re-do the pre-release checks (see the section above).
-
Update
package.yamlandChangeLog.md. This step differs between a first, second etc release candidate and a final release.-
package.yaml: bump to first odd patchlevel version (e.g.X.Y.0.1). -
ChangeLog.md: Rename the “Unreleased changes” section to the same version aspackage.yaml, and mark it clearly as a release candidate (e.g.vX.Y.0.1 (release candidate)). Remove any empty sections.
-
package.yaml: bump to next odd patchlevel version (e.g.X.Y.0.3). -
ChangeLog.md: Rename the “Unreleased changes” section to the same version aspackage.yaml, and mark it clearly as a release candidate (e.g.vX.Y.0.3 (release candidate)). Remove any empty sections.
-
package.yaml: bump version to odd last component and no patchlevel (e.g. fromX.Y.0.2toX.Y.1). -
ChangeLog.md: consolidate all the release candidate changes into a single section for the final release version.
Attention
After updating
package.yaml, be sure to update alsostack.cabal(for example by usingstack build --dry-run). -
-
Ensure the
stack ==constraint incabal.configis set to be equal to the same version aspackage.yaml. -
Follow the steps in the Release process section below that apply.
Release process¶
The release process differs between a first, second etc release candidate and a final release.
A: Integration tests workflow passes¶
Ensure that the GitHub Integration Tests workflow passes on the branch that you are releasing.
This workflow will run automatically for the rc/* branch.
B: Push a Git tag¶
Push a Git tag. The tag should be rc/vX.Y.Z.A, with X.Y.Z.A matching the
version in package.yaml.
For example, command:
C: Edit the draft GitHub release, and publish it¶
Wait for the GitHub Integration Tests workflow to complete for the branch you just created. This will create a draft GitHub release and upload the bindists (plus signatures and hashes) to it.
Edit the draft GitHub release:
- Add
(release candidate)to the name field and ensure that This is a pre-release is checked. - Add the ChangeLog to the description.
Publish the GitHub release.
D: Consider adding other platforms to the GitHub release¶
The Integration Tests workflow is limited to the platforms supported by the GitHub-hosted runners (currently, x86_64 and macOS/AArch64) and any self-hosted runners (currently, only Linux/AArch64). However, it is possible to edit the GitHub release to include binary distributions for other platforms. The prerequisites are:
- a computer with that platform (operating system, machine architecture);
- a sufficiently-recent existing version of Stack for that platform;
- a tool to print SHA checksums, such as
shasumon Linux and macOS; and - the GNU Privacy Guard tool (
gpg), which has had imported the private key used to sign Stack executables (see further below).
The steps are similar to those in the workflow:
-
Change to the root directory of the Stack project.
-
stack etc/scripts/release.hs check, to check before building. -
stack etc/scripts/release.hs build, to build. The output 'assets' (stack-<version>-<os>-<architecture> ...) will be in the_releasedirectory in the root directory of the Stack project. -
For each of the output assets, create a corresponding SHA 256 file with a
.sha256extension. For example (where<asset>is the name of the file): -
For each of the output assets, create a corresponding ASCII-armored signature file with an
.ascextension usinggpg. For example (where<asset>is the name of the file): -
Edit the GitHub release to include the output assets and their corresponding
.sha256and.ascfiles.
The private key used to sign Stack executables can be exported from a
version of gpg to which it has previously been imported with:
The private key, so obtained, can be imported into gpg by:
-
Commanding
gpg --import. -
Pasting the private key.
-
Entering Ctrl+D and Enter.
E: Update versions and ChangeLog.md for 'unreleased'¶
In the rc/vX.Y branch:
-
package.yaml: bump the version number. Bump the fourth component to an even number (e.g. from2.15.0.1to2.15.0.2).Attention
Be sure to update also
stack.cabal(for example by usingstack build --dry-run). -
ChangeLog.md: Add an “Unreleased changes” section (update the “changes since” version):
F: Request update of GHCup's metadata¶
Raise a pull request at the
haskell/ghcup-metadata GitHub
repository to request an addition to GHCup's latest metadata configuration
file for prereleases, tagged as the latest prerelease. In the metadata,
change the tags for any past Stack prereleases to indicate that they are no
longer the latest prerelease.
G: Announce the release candidate¶
Announce the release candidate to the following mailing lists
-
haskell-cafe@haskell.org
Note
You have to be a member of the mailing list to post to it. See the list's interface
-
haskell-stack@googlegroups.com
Note
Members of the group can post but posts from new members are held for moderation.
-
commercialhaskell@googlegroups.com
Note
Members of the group can post but posts from new members are held for moderation.
Announce the release candidate on the Haskell Community.
Announce the release candidate in the #stack-users channel of the Haskell
Foundation's Slack workspace.
Announce the release candidate in the
Haskell Stack room
(address #haskell-stack:matrix.org) on Matrix.
Announce the release candidate in Reddit's Haskell community.
In each case, use the subject (change 'first' to 'second' etc for subsequent release candidates):
ANN: first release candidate for stack-X.Y.Z
In the message, include:
- a link to the release on GitHub
(
https://github.com/commercialhaskell/stack/releases/tag/rc/vX.Y.Z.A) to download it - the release description from Github.
A: Integration tests workflow passes¶
Ensure that the GitHub Integration Tests workflow passes on the branch that you are releasing.
This workflow will run automatically for rc/* branches.
B: Push a Git tag¶
Push a Git tag. The tag should be vX.Y.Z, where X.Y.Z matches the
version in package.yaml.
For example, command:
C: Edit the draft GitHub release, and publish it¶
Wait for the GitHub Integration Tests workflow to complete for the tag you just created. This will create a draft GitHub release and upload the bindists (plus signatures and hashes) to it.
Edit the draft GitHub release:
- Add the ChangeLog to the description.
-
Get the list of contributors to the release and add it to the description. For example, command:
Publish the GitHub release.
D: Consider adding other platforms to the GitHub release¶
The Integration Tests workflow is limited to the platforms supported by the GitHub-hosted runners (currently, x86_64 and macOS/AArch64) and any self-hosted runners (currently, only Linux/AArch64). However, it is possible to edit the GitHub release to include binary distributions for other platforms. The prerequisites are:
- a computer with that platform (operating system, machine architecture);
- a sufficiently-recent existing version of Stack for that platform;
- a tool to print SHA checksums, such as
shasumon Linux and macOS; and - the GNU Privacy Guard tool (
gpg), which has had imported the private key used to sign Stack executables (see further below).
The steps are similar to those in the workflow:
-
Change to the root directory of the Stack project.
-
stack etc/scripts/release.hs check, to check before building. -
stack etc/scripts/release.hs build, to build. The output 'assets' (stack-<version>-<os>-<architecture> ...) will be in the_releasedirectory in the root directory of the Stack project. -
For each of the output assets, create a corresponding SHA 256 file with a
.sha256extension. For example (where<asset>is the name of the file): -
For each of the output assets, create a corresponding ASCII-armored signature file with an
.ascextension usinggpg. For example (where<asset>is the name of the file): -
Edit the GitHub release to include the output assets and their corresponding
.sha256and.ascfiles.
The private key used to sign Stack executables can be exported from a
version of gpg to which it has previously been imported with:
The private key, so obtained, can be imported into gpg by:
-
Commanding
gpg --import. -
Pasting the private key.
-
Entering Ctrl+D and Enter.
E: Upload to Hackage and reset branches¶
Upload the stack package to Hackage with the command:
Reset the release branch to the released commit. For example, with the
commands:
Update the stable branch to the released commit. For example, with the
commands:
Merge any changes made in the RC, release or stable branches to the
master branch. Be careful about version and ChangeLog.md. It is best to
do this by making a ci/merge-stable-to-master branch and waiting for CI to
pass, then merging. If anything is complicated to merge, consider making it
a pull request and getting it reviewed rather than merging immediately.
Delete the RC branch, both locally and on the remote. For example with the commands:
F: Activate the version on Read The Docs¶
Activate the version for new release tag, on readthedocs.org.
Ensure that the stable documentation has updated.
G: Update get.haskellstack.org redirects¶
Update the https://get.haskellstack.org redirects by updating the
_redirects file in the root of the
commercialhaskell/get-haskellstack-org GitHub
repository.
For further information, see the get.haskellstack.org redirects documentation.
Test with the commands:
and make sure it redirects to the new version.
H: Update versions and ChangeLog.md for 'unreleased'¶
In the stable branch:
-
package.yaml: bump the version number. Bump the third component to an even number (e.g. from2.15.1to2.15.2).Attention
Be sure to update also
stack.cabal(for example by usingstack build --dry-run). -
ChangeLog.md: Add an “Unreleased changes” section (update the “changes since” version):
I: Update the repository's issue and pull request templates¶
The repository's issue and pull request templates are the .github
directory. Update them to refer to the new release version (X.Y.Z).
J: Request update of GHCup's metadata¶
Raise a pull request at the
haskell/ghcup-metadata GitHub
repository to request an addition to GHCup's latest metadata configuration
files for releases and 'vanilla' releases, tagged as the latest release.
(The GHCup project will decide whether, and when, to recommend the release.)
In the metadata, change the tags for any past Stack releases to indicate
that they are no longer the latest release.
K: Announce the release¶
Announce the release to the following mailing lists
-
haskell-cafe@haskell.org
Note
You have to be a member of the mailing list to post to it. See the list's interface
-
haskell-stack@googlegroups.com
Note
Members of the group can post but posts from new members are held for moderation.
-
commercialhaskell@googlegroups.com
Note
Members of the group can post but posts from new members are held for moderation.
Announce the release on the Haskell Community.
Announce the release in the #stack-users channel of the Haskell
Foundation's Slack workspace.
Announce the release in the
Haskell Stack room
(address #haskell-stack:matrix.org) on Matrix.
Announce the release in Reddit's Haskell community.
In each case, use the subject:
* ANN: stack-X.Y.Z
In the message, include:
- the release description from Github.