# Checklist for a release

## Formatting, Spellchecking, Javadocs

    git pull

Do this until there are no errors.
Fix typos, add new words to dictionary.txt:

    ./build.sh clean compile spellcheck

Add documentation for all public methods. Make methods private if possible:

    ./build.sh clean compile javadocImpl

Ensure lines are not overly long:

    ./build.sh clean compile docs

## MVStore Jar File Size Verification

To ensure the MVStore jar file is not too large
(does not reference the database code by accident).
The file size should be about 300 KB:

    ./build.sh jarMVStore

## Changing Version Numbers

Update org.h2.engine.Constants.java:
    change the version and build number:
        set BUILD_DATE to today
        increment BUILD_ID, the value must be even (for example, 202)
        set VERSION_MAJOR / VERSION_MINOR to the new version number
    if the last TCP_PROTOCOL_VERSION_##
        doesn't have a release date set it to current BUILD_DATE
    check and update if necessary links to the latest releases in previous
    series of releases and their checksums in download.html

Update README.md.
    set version to the new version

Update changelog.html:
    * create a new "Next Version (unreleased)" with an empty list
    * add a new version
    * remove change log entries of the oldest version (keeping about 500 lines)

Update newsfeed.sql:
    * add new version, for example:
    * (150, '1.4.200', '2019-10-14'),
    * remove oldest entry in that list

Update download-archive.html:
    * add new version under Distribution section

## Skipped

* Minor version change: change sourceError.html and source.html
* If a beta, change download.html: Version ${version} (${versionDate}), Beta
* If a beta, change mainWeb.html: Version ${version} (${versionDate}), Beta

The following can be skipped currently; benchmarks should probably be removed:
* To update benchmark data: use latest versions of other dbs, change version(s) in performance.html

## Build the Release

In Build.java, comment "-Xdoclint:...", but don't commit that change.

Run the following commands:
Non-Windows:

    cd src/installer
    ./buildRelease.sh

Windows:

    cd src/installer
    buildRelease.bat

Scan for viruses.

Test installer, H2 Console (test new languages).

Check docs, versions and links in main, downloads, build numbers.

Check the PDF file size.

Upload (<x> = httpdocs and httpsdocs) to ftp://h2database.com/<x>/javadoc
Upload (<x> = httpdocs and httpsdocs) to ftp://h2database.com/<x>/
Upload (<x> = httpdocs and httpsdocs) to ftp://h2database.com/<x>/m2-repo

Github: create a release.

Newsletter: send (always to BCC!), the following:

    h2-database@googlegroups.com; h2database-news@googlegroups.com; ...

Create tweet at http://twitter.com

## Sign files and publish files on Maven Central

In Build.java, comment "-Xdoclint:none", but don't commit that change.

    ./build.sh clean compile jar mavenDeployCentral
    cd /data/h2database/m2-repo/com/h2database
    # remove sha and md5 files:
    find . -name "*.sha1" -delete
    find . -name "*.md5" -delete
    cd h2/1<latest>
    # for each file separately (-javadoc.jar, -sources.jar, .jar, .pom):
    gpg -u "Thomas Mueller Graf <thomas.tom.mueller@gmail.com>" -ab h2-<...>
    jar -cvf bundle.jar h2-*
    cd ../../h2-mvstore/1<latest>
    # for each file separately (-javadoc.jar, -sources.jar, .jar, .pom):
    gpg -u "Thomas Mueller Graf <thomas.tom.mueller@gmail.com>" -ab h2-mvstore<...>
    jar -cvf bundle.jar h2-*
    # http://central.sonatype.org/pages/ossrh-guide.html
    # http://central.sonatype.org/pages/manual-staging-bundle-creation-and-deployment.html
    # https://oss.sonatype.org/#welcome - Log In "t..."
    # sometimes this doesn't work reliably and you will have to retry
    # - Staging Upload
    # - Upload Mode: Artifact Bundle, Select Bundle to Upload... - /data/h2database/.../h2/.../bundle.jar
    # - Upload Bundle
    # - Staging Repositories - Refresh - select comh2database-<...> - Release - Confirm
    # - Staging Upload
    # - Upload Mode: Artifact Bundle, Select Bundle to Upload... - /data/h2database/.../h2-mvstore/.../bundle.jar
    # - Upload Bundle
    # - Staging Repositories - Refresh - select comh2database-<...> - Release - Confirm

Update statistics.

Change version in pom.xml, commit, add version-*.*.*** tag.

Update org.h2.engine.Constants.java:
    increment BUILD_ID again, the value must be odd (for example, 203)
Update h2/pom.xml.
    set ...-SNAPSHOT to the next version (with this odd third number)
Commit.
