openMSX Release Process
=======================

This is a kind of recipe for doing releases. Having it written down
decreases the chance of forgetting a small but crucial step during the
hectic work of getting a release out.

Preparing for a release
-----------------------

- Tell all developers to commit only fixes.
- Sync with most recent C-BIOS release.
- Check that the "staticbindist" build still works, in particular on
  Windows and macOS. This should be clear from the GitHub Actions at
  https://github.com/openMSX/openMSX/actions
- Verify the documentation is up-to-date.
  Currently most documentation is in "doc/manual".
- Write release notes in "doc/release-notes.txt".

Note: An alternative approach would be to create a branch dedicated to the
      release and continue accepting any kind of commit on "master".
      To put the development focus on bug fixing, we haven't done this,
      but it is an approach that might be useful at some point.

Creating a release candidate
----------------------------

The examples below use version 1.2.3. A release candidate gets a suffix like
"-rc1" in the version number and "_RC1" in the tag. Only the final release is
without such a suffix.

- Edit build/version.py:
  - Set the version number:
      packageVersionNumber = '1.2.3'
  - Set the suffix, for the first release candidate:
      packageVersionSuffix = '-rc1'
    For the final release, set it back to an empty string.
  - Set releaseFlag to True.
  - Increase androidReleaseVersionCode with 1.
  - Set releaseYear to the current year, if it isn't already.
- Update the title and release date in "doc/release-notes.txt", e.g.
    Release Notes for openMSX 1.2.3-RC1 (2026-10-31)
- Add the release notes to "doc/release-history.txt": copy the text of
  "doc/release-notes.txt" up to and including the list of changes, with a
  title like "openMSX 1.2.3-RC1 (2026-10-31)". For the final release, replace
  that release candidate entry with the final release notes.
- Don't forget to commit and push all these last changes before tagging!
- Check that the version information matches the tag you're going to create:
    build/check_release.py RELEASE_1_2_3_RC1 HEAD
  (The release workflow does this check again on the tag itself.)
- Tag the git archive:
    git tag -a RELEASE_1_2_3_RC1 -m "Tagging release 1.2.3-RC1."
    git push --tags
  For the final release:
    git tag -a RELEASE_1_2_3 -m "Tagging release 1.2.3."
- On GitHub Actions, run the release workflow for the new tag:
  https://github.com/openMSX/openMSX/actions/workflows/build_release_from_tag_via_tarball.yml
  Click open "Run workflow" at the top right, fill in the tag (e.g.
  "RELEASE_1_2_3_RC1") at "Release tag to build" and click "Run workflow".
  This workflow:
  - checks that the tag matches the version number, suffix and release flag
    in build/version.py, the title of doc/release-notes.txt and an entry in
    doc/release-history.txt (build/check_release.py), and stops if not
  - creates the distribution tarball (build/gitdist.py) from the tag
  - builds the binaries for all platforms that can be built there from that
    tarball. The Windows (Visual C++) build includes Catapult, taken from the
    latest wxCatapult CI build.
  - creates a draft release on GitHub for the tag (or reuses an existing one),
    with the release notes as description and all built files (including the
    tarball) attached. A release candidate (a tag ending in _RC<n>) is marked
    as pre-release.
- For your own sanity check (see below), you can also create the tarball
  locally:
    build/gitdist.py RELEASE_1_2_3_RC1
  The result ends up in "derived/dist/".

Sanity check on release candidate
---------------------------------

This is a small check to be performed by the release coordinator.

- Test build:
  * Compile and check for warnings:
      unset OPENMSX_FLAVOUR   (and any other OPENMSX_ flags you have set)
      make
  * Test installation:
      sudo make install
- Start openmsx with your usual config.
- Verify the version number in the title bar.

If the sanity check is passed, distribute the release candidate to fellow
developers and testers, e.g. by publishing the draft release as a
pre-release (see below).

Full test of release candidate
------------------------------

- Check behaviour with empty ~/.openMSX dir.
- Check that the default config (C-BIOS_MSX2+) works.
- Check random other configs.
- Do extensive testing with things that are known to work and likely to
  give problems (like Unknown Reality, Metal Limit).
- Do some valgrind runs to make sure there are no hidden problems.
TODO: More standard tests?

Repeat until release worthy
---------------------------

Create and test release candidates until a satisfactory release candidate
is made, which will become the release.

If there are any last-minute patches, don't forget to set a new release
tag, such that the released code is based on exactly the tagged code.

Make the release public
-----------------------

The release workflow (see above) created a draft release on GitHub. Finish it
(refer to https://docs.github.com/en/repositories/releasing-projects-on-github):
- Make sure you're logged in
- Go to https://github.com/openMSX/openMSX/releases and edit the draft
  release for the tag, e.g. RELEASE_1_2_3
- Check the title, which the workflow derives from the tag, e.g.
  "openMSX 1.2.3" or "openMSX 1.2.3-RC1".
- The description contains the full release notes. Shorten it to the first
  few paragraphs (before the list of changes starts), if you like.
- Check that all expected files are attached.
- Check that a release candidate is marked as pre-release (the workflow does
  that), and for the final release check "Set as the latest release".
- Publish the release.
- Note: GitHub also generates a tarball and a zip file. Just ignore it for
  now. Do not use these in any links on our website or somewhere else.
  They contain a lot of unnecessary stuff.

Announce:
- Post change list to msx.org.
- Post news item on web site.
- Post news item on our Facebook page.
- Post an announcement on our Discord server.
- Post news and/or change list to openmsx-devel and openmsx-user
  mailinglists (at least one packager uses it to get a trigger)

Finally:
- Update the web site:
  - in the htdocs repo:
    - Point to new downloads.
    - Update the list "features of current release"
    - When done, commit and push
  - Make sure you have a clone of the openMSX.github.io repo as well, and go to
    it. This repo contains the web site as it is live (so not the sources)
  - Run the update.sh script, which will update the files based on the
    htdocs/openMSX and wxcatapult repos and converts the php to html
  - Review the changes and commit and push to publish them immediately on the
    site.
- Set releaseFlag to False in build/version.py
- Update libraries in the 3rd party build system to latest versions, so
  that next release will profit from this and you won't forget it. Just
  before the release is too late (unless it's some minor security fix)!
