# Trip Version 2 - Release Procedure

## Changelog

1.  Update `./CHANGELOG.md` with the changes in this release.

## Version Control

1.  Update `master` branch in `trip-server-common` sub-project

1.  Push `master` branch in `trip-server-common` sub-project

1.  Checkin the updated `master` branch from the `trip-server-common` sub-project

## Build

1.  Update version number in `configure.ac`

1.  Create the distribution tarballs

		$ autoreconf -i

	on Debian:

		$ ./configure --enable-cairo --enable-tui --enable-maintainer-mode
		$ make -j 4 check
		$ MAKEFLAGS='-j 4' make distcheck

	on macOS:

		$ ./configure CXX=/usr/bin/clang++ \
		'CXXFLAGS=-Wno-deprecated-builtins -Wno-deprecated-literal-operator '\
		'-Wno-unused-but-set-variable' \
		PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:"\
		"/opt/local/lib/proj9/lib/pkgconfig:"\
		"$(pg_config --libdir)/pkgconfig" \
		--enable-cairo --enable-tui --enable-maintainer-mode

		$ make -j 8 check

		$ PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:"\
		"/opt/local/lib/proj9/lib/pkgconfig:"\
		"/opt/local/lib/postgresql15/pkgconfig" \
		DISTCHECK_CONFIGURE_FLAGS='CXX=/usr/bin/clang++ '\
		'CXXFLAGS=-Wno-deprecated-builtins\ -Wno-deprecated-literal-operator\ '\
		'-Wno-unused-but-set-variable' \
		MAKEFLAGS='-j 8' make distcheck

1.  Create SHA256 sums for the tarballs

1.  Sign the SHA256 sums file:

		$ gpg --detach-sign --armor $SHA256SUMS

1.  Copy the release files to the download site

1.  Build PDF and HTML docs

		$ make html pdf

1.  Check in the changed files, including the updated `po` language files

## Docker

1.  Optionally, check the `Dockerfile` has been updated to the use the correct
	release version number.  The version information is updated by `configure`
	when `Dockerfile` is created from `Dockerfile.in`.

		$ grep 'ARG TRIP_SERVER_VERSION' Dockerfile
		$ grep LABEL Dockerfile Dockerfile-postgis

1.	Optionally, build a test Docker `arm64` image:

		$ docker build --platform=linux/arm64 --build-arg MAKEFLAGS='-j 4' \
		-t fdean/trip-server-2:latest .
		$ docker compose up --detach
		$ docker logs --follow trip-server-2_web_1

	Stop the container, optionally with (use the `--volumes` switch to also
    remove the database volume):

		$ docker compose down --volumes

1.  Build the `arm64` and `amd64` Docker images, e.g.

	1.  Optionally, Update `Dockerfile-postgis` to use the latest
		[PostgreSQL build](https://hub.docker.com/_/postgres).

	1.  Build the `trip-database` and `trip-server` images:

			$ MAKEFLAGS='-j 4' DOCKER=podman PUSH=n ./docker-build.sh

## Installation

	$ ./configure
	$ make
	$ make html pdf
	$ sudo make install install-html install-pdf

## Release

1.  Copy the builds, SHA256 sums, HTML and PDF docs to the Trip Server 2
    website

1.  Update the index page with details of the new release

1.  Update the symbolic link to point to the latest docs

1.  Tag the `master` branch of the parent project with release version number

1.  Push the master branch and check
    <https://www.fdsd.co.uk/trip-server-2/readme.html> has been updated

1.  Push Docker images:

		$ MAKEFLAGS='-j 4' DOCKER=podman ./docker-build.sh

## Validation

1.  Check the website links for all the user documentation

1.  Check the `Help` menu item correctly links to the latest user guide

1.  Check the tarballs download

1.  Download the checksums file and validate against the downloaded tarballs
