Update release-tool instructions

Jonathan White
2025-11-11 16:05:12 -05:00
parent 02fda1c0e2
commit 1564b68ed0

@@ -125,89 +125,58 @@ make test
_Note: the importcsv test requires a UTF-8 environment to run successfully._
# Building using the release-tool
Starting with version 2.1.1, KeePassXC ships with a `release-tool` that automates building release packages from a specified release tag (the `--version parameter`). To see a help listing for the command, download and unpack the source code as described in the [Linux](#linux) section, change into the source directory and run
# Building using the Python release-tool
Starting with version 2.7.11, KeePassXC ships with a python `release-tool.py` that automates building release packages from a specified release tag (the `--version parameter`). To see a help listing for the command, download and unpack the source code as described in the [Linux](#linux) section, change into the source directory and run
```
./release-tool help
python release-tool.py
```
The `release-tool` has three subcommands. You can get help for each by running
The `release-tool` has several subcommands. Only the `build` subcommand is relevant to non-maintainers. You can get help for each by adding `-h` after the subcommand.
```
./release-tool help <COMMAND>
python release-tool.py <SUBCOMMAND> -h
```
Sub commands are:
## build
## build subcommand
```
$ ./release-tool help build
KeePassXC Release Preparation Helper
Copyright (C) 2017 KeePassXC Team <https://keepassxc.org/>
$ python release-tool.py build -h
KeePassXC Release Preparation Tool
Copyright (C) 2016-2025 KeePassXC Team <https://keepassxc.org/>
Usage: release-tool build [options]
usage: release-tool.py build [-h] [-s SRC_DIR] [-t TAG_NAME] [-o OUTPUT_DIR] [-g CMAKE_GENERATOR] [-i INSTALL_PREFIX]
[--snapshot] [--use-system-deps] [-j PARALLELISM] [-y] [--with-tests] [-p {amd64,arm64}]
[--sign] [--sign-cert SIGN_CERT] [-c ...]
version
Build and package binary release from sources
positional arguments:
version Release version number or name.
Options:
-v, --version Release version number or name (required)
-a, --app-name Application name (default: 'KeePassXC')
-s, --source-dir Source directory (default: '.')
-o, --output-dir Output directory where to build the release
(default: 'release')
-t, --tag-name Release tag to check out (defaults to version number)
-b, --build Build sources after exporting release
-d, --docker-image Use the specified Docker image to compile the application.
The image must have all required build dependencies installed.
This option has no effect if --build is not set.
--container-name Docker container name (default: 'keepassxc-build-container')
The container must not exist already
-c, --cmake-options Additional CMake options for compiling the sources
--compiler Compiler to use (default: 'g++')
-m, --make-options Make options for compiling sources (default: '-j8')
-i, --install-prefix Install prefix (default: '/usr/local')
-p, --plugins Space-separated list of plugins to build
(default: autotype)
-n, --no-source-tarball Don't build source tarball
-h, --help Show this help
```
## merge (only useful for KeePassXC maintainers)
```
$ ./release-tool help merge
KeePassXC Release Preparation Helper
Copyright (C) 2017 KeePassXC Team <https://keepassxc.org/>
Usage: release-tool merge [options]
Merge release branch into main branch and create release tags
Options:
-v, --version Release version number or name (required)
-a, --app-name Application name (default: 'KeePassXC')
-s, --source-dir Source directory (default: '.')
-g, --gpg-key GPG key used to sign the merge commit and release tag,
leave empty to let Git choose your default key
(default: '')
-r, --release-branch Source release branch to merge from (default: 'release/VERSION')
--target-branch Target branch to merge to (default: 'master')
-t, --tag-name Override release tag name (defaults to version number)
-h, --help Show this help
```
## sign (only useful for KeePassXC maintainers)
```
$ ./release-tool help sign
KeePassXC Release Preparation Helper
Copyright (C) 2017 KeePassXC Team <https://keepassxc.org/>
Usage: release-tool sign [options]
Sign previously compiled release packages
Options:
-f, --files Files to sign (required)
-g, --gpg-key GPG key used to sign the files (default: 'CFB4C2166397D0D2')
-h, --help Show this help
options:
-h, --help show this help message and exit
-s, --src-dir SRC_DIR
Source directory.
-t, --tag-name TAG_NAME
Name of the tag to check out (default: same as version).
-o, --output-dir OUTPUT_DIR
Build output directory (default: release.
-g, --cmake-generator CMAKE_GENERATOR
Override default CMake generator.
-i, --install-prefix INSTALL_PREFIX
Build install prefix (default: /usr/local).
--snapshot Build snapshot from current HEAD.
--use-system-deps Use system dependencies instead of vcpkg.
-j, --parallelism PARALLELISM
Build parallelism (default: 22).
-y, --yes Bypass confirmation prompts.
--with-tests Build and run tests.
-p, --platform-target {amd64,arm64}
Build target platform (default: amd64).
--sign Sign binaries prior to packaging.
--sign-cert SIGN_CERT
SHA1 fingerprint of the signing certificate (optional).
-c, --cmake-opts ... Additional CMake options (no other arguments can be specified after this).
```
If you are not a KeePassXC maintainer, the only interesting command for you is `release-tool build`. This will automate the compilation and packaging steps described [above](#building-keepassxc-manually) and also perform a few more packaging steps such as exporting a source tarball and building an [AppImage](http://appimage.org/) on Linux.
The build subcommand automates the compilation and packaging steps described [above](#building-manually) and also performs a few more packaging steps such as exporting a source tarball and building an [AppImage](https://appimage.org/) on Linux.
When not specified otherwise, it will create a directory called `release` containing the build directory, a source tarball and the packaged binary bundles. On Linux, there will also be a directory `release-bin` inside the `release` directory, containing stripped versions of all the compiled binaries without additional dependencies.
When not specified otherwise, it will create a directory called `release` containing the build directory, a source tarball and the packaged binary bundles. On Linux, there will also be a directory ending with `.AppDir` inside the `release` directory, containing stripped versions of all the compiled binaries without additional dependencies.
# Building inside a Docker container
The `release-tool` also allows you to build KeePassXC inside a Docker container on Linux. This is important when building a cross-platform `AppImage`. To pull the needed Docker image, run
@@ -216,6 +185,6 @@ docker pull keepassxc/keepassxc-ci
```
This will pull the latest Docker image from the Docker hub registry. You can then start the build process with
```
./release-tool build -v VERSION --appimage -d keepassxc/keepassxc-ci
python release-tool.py build <VERSION> --appimage -d keepassxc/keepassxc-ci
```
**Important:** rebuild the image regularly with `--no-cache` to ensure it has the latest security updates!
**Important:** rebuild the docker image regularly with `--no-cache` to ensure it has the latest security updates!