Inspired by Liip RMT, this release tool helps you to automate the release of new versions of your software. It is written in PHP but can be used for any type of project, as long as you have PHP installed on your machine.
- Determines the next version number based on semantic versioning
- Creates an annotated Git tag and pushes it to the remote repository
- Creates a GitHub release with the name of the release and a changelog with changes since the previous version
- Supports pre-release (alpha/beta/rc) versions
The recommended method of installing this package is using a phar file. This is because installing using Composer can possibly cause dependency conflicts. You can download the most recent phar from the Github Releases page.
Move the downloaded release-tool.phar
file into your PATH (e.g. ~/bin/release-tool
). Make sure to set the file to executable permissions (e.g. chmod 775 release-tool
).
Alternatively, you can install this package using Composer:
composer require --dev leviy/release-tool
This tool requires a personal access token with repo
scope to create GitHub
releases. Create one here
and store it in .release-tool/auth.yml
in your home folder (~
on Linux, user
folder on Windows):
credentials:
github:
token: <token>
Note: these usage instructions assume that you have downloaded the
release-tool.phar
file to your project directory. If you have installed it in a different location, update the commands accordingly. If you have installed the tool as a Composer dependency, usevendor/bin/release
instead.
Use release-tool.phar release <version>
to release a version. For example:
release-tool.phar release 1.0.0
This will release version 1.0.0. By default, this will create a prefixed,
annotated Git tag, in this case v1.0.0
.
After tagging a first version, you can let the tool calculate the new version number for you based on the current version and a number of questions. To do so, omit the version from the previous command:
release-tool.phar release
If you want to create a pre-release (alpha/beta/rc) version, run:
release-tool.phar release --pre-release
Run release-tool.phar list
to see a list of available commands.
The following command will update the release tool to the latest version:
release-tool.phar self-update