PHPackages                             liip/rmt - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. liip/rmt

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

liip/rmt
========

Release Management Tool: a handy tool to help releasing new version of your software

1.9.0(5mo ago)457448.7k—4%46[16 issues](https://github.com/liip/RMT/issues)[6 PRs](https://github.com/liip/RMT/pulls)20MITPHPPHP ^7.4|^8.0CI failing

Since Nov 25Pushed 5mo ago57 watchersCompare

[ Source](https://github.com/liip/RMT)[ Packagist](https://packagist.org/packages/liip/rmt)[ Docs](http://github.com/liip/RMT)[ RSS](/packages/liip-rmt/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (62)Used By (20)

RMT - Release Management Tool
=============================

[](#rmt---release-management-tool)

[![Build Status](https://github.com/liip/rmt/actions/workflows/ci.yml/badge.svg)](https://github.com/liip/rmt/actions/workflows/ci.yml)[![Latest Stable Version](https://camo.githubusercontent.com/60704ceed9415bac21fb949697cca361e004888f74a1b5229f6e9e38128474e5/68747470733a2f2f706f7365722e707567782e6f72672f6c6969702f524d542f76657273696f6e2e706e67)](https://packagist.org/packages/liip/RMT)[![Total Downloads](https://camo.githubusercontent.com/240776725304ee9800e0e5e47cc744b3bc0c112e17bf01e7657569d2baf03f88/68747470733a2f2f706f7365722e707567782e6f72672f6c6969702f524d542f642f746f74616c2e706e67)](https://packagist.org/packages/liip/RMT)[![License](https://camo.githubusercontent.com/5c41967bdb96c89c0005e08ee436198cac0e3f2af0284a40625d31d786f0169f/68747470733a2f2f706f7365722e707567782e6f72672f6c6969702f726d742f6c6963656e73652e737667)](https://packagist.org/packages/liip/rmt)

RMT is a handy tool to help releasing new versions of your software. You can define the type of version generator you want to use (e.g. semantic versioning), where you want to store the version (e.g. in a changelog file or as a VCS tag) and a list of actions that should be executed before or after the release of a new version.

Installation
------------

[](#installation)

### Option 1: As a development dependency of your project

[](#option-1-as-a-development-dependency-of-your-project)

To use RMT in your project you should use [Composer](http://getcomposer.org/) to install it as a dev-dependency. Just go to your project's root directory and execute:

```
composer require --dev liip/rmt

```

Then you must initialize RMT by running the following command:

```
php vendor/liip/rmt/command.php init

```

This command will create a `.rmt.yml` config file and a `RMT` executable script in your project's root folder. You can now start using RMT by executing:

```
./RMT

```

Once there, your best option is to pick one of the [configuration examples](#configuration-examples) below and adapt it to your needs.

If you are using a versioning tool, we recommend adding both Composer files (`composer.json`and `composer.lock`), the RMT configuration file(`.rmt.yml`) and the `RMT` executable script to it. The `vendor` directory should be ignored as it is populated when running `composer install`.

### Option 2: As a global Composer installation

[](#option-2-as-a-global-composer-installation)

You can add RMT to your global composer.json and have it available globally for all your projects. Therefor just run the following command:

```
composer global require liip/rmt

```

Make sure you have `~/.composer/vendor/bin/` in your $PATH.

### Option 3: As a Phar file

[](#option-3-as-a-phar-file)

RMT can be installed through [phar-composer](https://github.com/clue/phar-composer/), which needs to be [installed](https://github.com/clue/phar-composer/#install) therefor. This useful tool allows you to create runnable Phar files from Composer packages.

If you have phar-composer installed, you can run:

```
sudo phar-composer install liip/RMT

```

and have phar-composer build and install the Phar file to your $PATH, which then allows you to run it simply as `rmt` from the command line or you can run

```
phar-composer build liip/RMT

```

and copy the resulting Phar file manually to where you need it (either make the Phar file executable via `chmod +x rmt.phar` and execute it directly `./rmt.phar` or run it by invoking it through PHP via `php rmt.phar`.

For the usage substitute RMT with whatever variant you have decided to use.

### Option 4: As Drifter role

[](#option-4-as-drifter-role)

If you are using  for your project, you just need three step

- Activate the `rmt` role
- Re-run the provisioning `vagrant provision`
- Init RMT for your project `php /home/vagrant/.config/composer/vendor/liip/rmt/RMT`

Usage
-----

[](#usage)

Using RMT is very straightforward, just run the command:

```
./RMT release

```

RMT will then execute the following tasks:

1. Execute the prerequisites checks
2. Ask the user to answers potentials questions
3. Execute the pre-release actions
4. Release
    - Generate a new version number
    - Persist the new version number
5. Execute the post-release actions

Here is an example output:

[![screenshot](https://github.com/liip/RMT/raw/master/docs/output-example.png "First stable for RMT")](https://github.com/liip/RMT/raw/master/docs/output-example.png)

### Additional commands

[](#additional-commands)

The `release` command provides the main behavior of the tool, additional some extra commands are available:

- `current` will show your project current version number (alias version)
- `changes` display the changes that will be incorporated in the next release
- `config` display the current config (already merged)
- `init` create (or reset) the .rmt.yml config file

Configuration
-------------

[](#configuration)

All RMT configurations have to be done in `.rmt.yml`. The file is divided in six root elements:

- `vcs`: The type of VCS you are using, can be `git`, `svn` or `none`
    - For `git` VCS you can use the two following options `sign-tag` and `sign-commit` if you want to GPG sign your release
- `prerequisites`: A list `[]` of prerequisites that must be matched before starting the release process
- `pre-release-actions`: A list `[]` of actions that will be executed before the release process
- `version-generator`: The generator to use to create a new version (mandatory)
- `version-persister`: The persister to use to store the versions (mandatory)
- `post-release-actions`: A list `[]` of actions that will be executed after the release

All entries of this config work the same. You have to specify the class you want to handle the action. Example:

```
version-generator: "simple"`
version-persister:
   vcs-tag:
       tag-prefix: "v_"

```

RMT also support JSON configs, but we recommend using YAML.

### Branch specific config

[](#branch-specific-config)

Sometimes you want to use a different release strategy according to the VCS branch, e.g. you want to add CHANGELOG entries only in the `main` branch. To do so, you have to place your default config into a root element named `_default`, then you can override parts of this default config for the branch `main`. Example:

```
_default:
    version-generator: "simple"
    version-persister: "vcs-tag"
main:
    pre-release-actions: [changelog-update]

```

You can use the command `RMT config` to see the merge result between \_default and your current branch.

### Version generator

[](#version-generator)

Build-in version number generation strategies.

- simple: This generator is doing a simple increment (1,2,3...)
- semantic: A generator, which implements [Semantic versioning](http://semver.org)

    - Option `allow-label` (boolean): To allow adding a label on a version (such as -beta, -rcXX) (default: *false*)
    - Option `type`: to force the version type
    - Option `label`: to force the label

    The two forced option could be very useful if you decide that a given branch is dedicated to the next beta of a given version. So just force the label to beta and all release are going to be beta increments.

### Version persister

[](#version-persister)

Class in charge of saving/retrieving the version number.

- vcs-tag: Save the version as a VCS tag

    - Option `tag-pattern`: Allow to provide a regex that all tag must match. This allows for example to release a version 1.X.X in a specific branch and to release a 2.X.X in a separate branch
    - Option `tag-prefix`: Allow to prefix all VCS tag with a string. You can have a numeric versioning but generation tags such as `v_2.3.4`. As a bonus you can use a specific placeholder: `{branch-name}` that will automatically inject the current branch name in the tag. So use, simple generation and `tag-prefix: "{branch-name}_"` and it will generate tag like `featureXY_1`, `featureXY_2`, etc...
- changelog: Save the version in the changelog file

    - Option `location`: Changelog file name an location (default: *CHANGELOG*)

### Prerequisite actions

[](#prerequisite-actions)

Prerequisite actions are executed before the interactive part.

- `working-copy-check`: check that you don't have any VCS local changes
    - Option `allow-ignore`: allow the user to skip the check when doing a release with `--ignore-check`
- `display-last-changes`: display your last changes
- `tests-check`: run the project test suite
    - Option `command`: command to run (default: *phpunit*)
    - Option `timeout`: the amount of seconds after which the command times out (default: *60.0*)
    - Option `expected_exit_code`: expected return code (default: 0)
- `composer-json-check`: run a validated on the composer.json
    - Option `composer`: how to run composer (default: *php composer.phar*)
- `composer-stability-check`: will check if the composer.json is set to the right minimum-stability
    - Option `stability`: the stability that should be set in the minimum-stability field (default: *stable*)
- `composer-audit`: run `composer audit` - requires at least composer 2.4.
- `composer-dependency-stability-check`: test if only allowed dependencies are using development versions
    - Option `ignore-require` and `ignore-require-dev`: don't check dependencies in `require` or `require-dev` section
    - Option `whitelist`: allow specific dependencies to use development version
- `command`: Execute a system command
    - Option `cmd` The command to execute (variables `%version%` and `%new_version%` can be used)
    - Option `live_output` boolean, do we display the command output? (default: *true*)
    - Option `timeout` integer, limits the time for the command. (default: *600*)
    - Option `stop_on_error` boolean, do we break the release process on error? (default: *true*)

### Actions

[](#actions)

Actions can be used for pre or post release parts.

- `changelog-update`: Update a changelog file. This action is further configured to use a specific formatter.
    - Option `format`: *simple*, *semantic*, *markdown* or *addTop* (default: *simple*)
    - Option `file`: path from .rmt.yml to changelog file (default: *CHANGELOG*)
    - Option `dump-commits`: write all commit messages since the last release into the changelog file (default: *false*)
    - Option `insert-at`: only for addTop formatter: Amount lines to skip from the top of the changelog file before adding the release number (default: 0)
    - Option `exclude-merge-commits`: Exclude merge commits from the changelog (default: *false*)
- `vcs-commit`: commit all files of the working copy (only use it with the `working-copy-check` prerequisite)
    - Option `commit-message`: specify a custom commit message. %version% will be replaced by the current / next version strings.
- `vcs-tag`: Tag the last commit
- `vcs-publish`: Publish the changes (commits and tags)
- `composer-update`: Update the version number in a composer file (note that when using packagist.org, it is recommended to not have a tag in composer.json as the version is handled by version control tags)
- `files-update`: Update the version in one or multiple files. For each file to update, please provide an array with
    - Option `file`: path to the file to update
    - Option `pattern`: optional, use to specify the string replacement pattern in your file. For example: `const VERSION = '%version%';`
- `build-phar-package`: Builds a Phar package of the current project whose filename depends on the 'package-name' option and the deployed version: \[package-name\]-\[version\].phar
    - Option `package-name`: the name of the generated package
    - Option `destination`: the destination directory to build the package into. If prefixed with a slash, is considered absolute, otherwise relative to the project root.
    - Option `excluded-paths`: a regex of excluded paths, directly passed to the [Phar::buildFromDirectory](http://php.net/manual/en/phar.buildfromdirectory.php) method. Ex: `/^(?!.*cookbooks|.*\.vagrant|.*\.idea).*$/im`
    - Option `metadata`: an array of metadata describing the package. Ex author, project. Note: the release version is added by default but can be overridden here.
    - Option `default-stub-cli`: the default stub for CLI usage of the package.
    - Option `default-stub-web`: the default stub for web application usage of the package.
- `command`: Execute a system command
    - Option `cmd` The command to execute (variables `%version%` and `%new_version%` can be used)
    - Option `live_output` boolean, do we display the command output? (default: *true*)
    - Option `timeout` integer, limits the time for the command. (default: *600*)
    - Option `stop_on_error` boolean, do we break the release process on error? (default: *true*)
- `update-version-class`: Update the version constant in a class file. DEPRECATED, use `files-update` instead
    - Option `class`: path to class to be updated, or fully qualified class name of the class containing the version constant
    - Option `pattern`: optional, use to specify the string replacement pattern in your version class. %version% will be replaced by the current / next version strings. For example you could use `const VERSION = '%version%';`. If you do not specify this option, every occurrence of the version string in the file will be replaced.

Extend it
---------

[](#extend-it)

RMT is providing some existing actions, generators and persisters. If needed you can add your own by creating a PHP script in your project, and referencing it in the configuration via it's relative path:

```
version-generator: "bin/myOwnGenerator.php"

```

Example with injected parameters:

```
version-persister:
    name: "bin/myOwnGenerator.php"
    parameter1: value1

```

As an example, you can look at the script [/bin/UpdateApplicationVersionCurrentVersion.php](https://github.com/liip/RMT/blob/master/bin/UpdateApplicationVersionCurrentVersion.php) configured [here](https://github.com/liip/RMT/blob/master/.rmt.yml#L9).

*WARNING:* As the key `name` is used to define the name of the object, you cannot have a parameter named `name`.

Configuration examples
----------------------

[](#configuration-examples)

Most of the time, it will be easier for you to pick up an example below and adapt it to your needs.

### No VCS, changelog updater only

[](#no-vcs-changelog-updater-only)

```
version-generator: semantic
version-persister: changelog

```

### Using Git tags, simple versioning and prerequisites

[](#using-git-tags-simple-versioning-and-prerequisites)

```
vcs: git
version-generator: simple
version-persister: vcs-tag
prerequisites: [working-copy-check, display-last-changes]

```

### Using Git tags, simple versioning and composer-prerequisites

[](#using-git-tags-simple-versioning-and-composer-prerequisites)

```
vcs: git
version-generator: simple
version-persister: vcs-tag
prerequisites:
    - composer-json-check
    - composer-stability-check:
        stability: beta
    - composer-dependency-stability-check:
        whitelist:
            - [symfony/console]
            - [phpunit/phpunit, require-dev]

```

### Using Git tags, simple versioning and prerequisites, and gpg sign commit and tags

[](#using-git-tags-simple-versioning-and-prerequisites-and-gpg-sign-commit-and-tags)

```
vcs:
  name: git
  sign-tag: true
  sign-commit: true
version-generator: simple
version-persister: vcs-tag
prerequisites: [working-copy-check, display-last-changes]

```

### Using Git tags with a prefix, semantic versioning, updating two files and pushing automatically

[](#using-git-tags-with-a-prefix-semantic-versioning-updating-two-files-and-pushing-automatically)

```
vcs: git
version-generator: semantic
version-persister:
    name: vcs-tag
    tag-prefix : "v_"
pre-release-actions:
    files-update:
        - [config.yml]
        - [app.ini, 'dynamic-version: %version%']
post-release-actions: [vcs-publish]

```

### Using semantic versioning on main and simple versioning on topic branches, markdown formatting for changelog

[](#using-semantic-versioning-on-main-and-simple-versioning-on-topic-branches-markdown-formatting-for-changelog)

```
_default:
    vcs: git
    prerequisites: [working-copy-check]
    version-generator: simple
    version-persister:
        name: vcs-tag
        tag-prefix: "{branch-name}_"
    post-release-actions: [vcs-publish]

# This entry allow to override some parameters for the main branch
main:
    prerequisites: [working-copy-check, display-last-changes]
    pre-release-actions:
        changelog-update:
            format: markdown
            file: CHANGELOG.md
            dump-commits: true
        update-version-class:
            class: Doctrine\ODM\PHPCR\Version
            pattern: const VERSION = '%version%';
        vcs-commit: ~
    version-generator: semantic
    version-persister: vcs-tag

```

### Changing the default-branch:

[](#changing-the-default-branch)

```
_default:
    vcs:
        name: git
        default-branch: my-default-branch

```

Contributing
------------

[](#contributing)

If you would like to help, by submitting one of your action scripts, generators or persisters. Or just by reporting a bug just go to the project page .

If you provide a PR, try to associate it some unit or functional tests. See next section

Tests
-----

[](#tests)

### Requirements

[](#requirements)

To be able to run the tests locally, you need:

- phpunit
- git
- mercurial

You can install all of them with Brew:

```
> brew install phpunit git hg

```

The tests are also testing the creation of the RMT phar. So you have to allow this in your php.ini, by uncommenting this line:

```
phar.readonly = Off

```

Finally, to run the tests, just launch PHPUnit

```
> phpunit

```

### Functional tests

[](#functional-tests)

The functional tests are fully functional temporary RMT setup. Each time you run functional test, it creates a temporary folder with a RMT project. Then the test suite is running RMT commands on it, and check the results. That's why you need to have Git and Mercurial installed.

#### Debug

[](#debug)

To debug RMT functional tests, the best is to go into this temporary folder and manually explore the project. To do so, just add a small `$this->manualDebug();` into the test suite. This will break the test with the following output:

```
MANUAL DEBUG Go to:
> cd /private/var/folders/hl/gnj5dcj55gbc93pcgrjxbb0w0000gn/T/ceN2Mf

```

Then you just have to go into the mentioned folder and start debugging

Authors
-------

[](#authors)

- Jonathan Macheret, Liip SA
- David Jeanmonod Liip SA
- and [others contributors](https://github.com/liip/RMT/graphs/contributors)

License
-------

[](#license)

RMT is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

###  Health Score

66

—

FairBetter than 99% of packages

Maintenance70

Regular maintenance activity

Popularity56

Moderate usage in the ecosystem

Community48

Growing community involvement

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 63.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~82 days

Recently: every ~195 days

Total

59

Last Release

166d ago

Major Versions

0.9.16 → 1.0.02013-12-20

PHP version history (6 changes)0.9.1PHP &gt;=5.2.0

0.9.6PHP &gt;=5.3.3

1.2.0PHP &gt;=5.3.9

1.3.0PHP ^5.6|^7.0

1.6.2PHP ^7.1|^8.0

1.8.0PHP ^7.4|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/f081ca8cb8aed6700cf653d466e81ad7fe2110c3826e3200d13af1a4df442d8b?d=identicon)[jeanmonod](/maintainers/jeanmonod)

---

Top Contributors

[![jeanmonod](https://avatars.githubusercontent.com/u/114489?v=4)](https://github.com/jeanmonod "jeanmonod (293 commits)")[![krtek4](https://avatars.githubusercontent.com/u/963772?v=4)](https://github.com/krtek4 "krtek4 (35 commits)")[![dbu](https://avatars.githubusercontent.com/u/76576?v=4)](https://github.com/dbu "dbu (27 commits)")[![Jonathanm10](https://avatars.githubusercontent.com/u/8361115?v=4)](https://github.com/Jonathanm10 "Jonathanm10 (25 commits)")[![sitron](https://avatars.githubusercontent.com/u/90797?v=4)](https://github.com/sitron "sitron (17 commits)")[![lsmith77](https://avatars.githubusercontent.com/u/300279?v=4)](https://github.com/lsmith77 "lsmith77 (11 commits)")[![bonndan](https://avatars.githubusercontent.com/u/143695?v=4)](https://github.com/bonndan "bonndan (8 commits)")[![acrobat](https://avatars.githubusercontent.com/u/1374857?v=4)](https://github.com/acrobat "acrobat (7 commits)")[![seyfahni](https://avatars.githubusercontent.com/u/8677475?v=4)](https://github.com/seyfahni "seyfahni (4 commits)")[![Ph0tonic](https://avatars.githubusercontent.com/u/5320541?v=4)](https://github.com/Ph0tonic "Ph0tonic (4 commits)")[![ppetermann](https://avatars.githubusercontent.com/u/69334?v=4)](https://github.com/ppetermann "ppetermann (3 commits)")[![nimah79](https://avatars.githubusercontent.com/u/20343056?v=4)](https://github.com/nimah79 "nimah79 (3 commits)")[![ahilles107](https://avatars.githubusercontent.com/u/298610?v=4)](https://github.com/ahilles107 "ahilles107 (3 commits)")[![tgalopin](https://avatars.githubusercontent.com/u/1651494?v=4)](https://github.com/tgalopin "tgalopin (3 commits)")[![evs-xsarus](https://avatars.githubusercontent.com/u/44158071?v=4)](https://github.com/evs-xsarus "evs-xsarus (2 commits)")[![gildegoma](https://avatars.githubusercontent.com/u/434654?v=4)](https://github.com/gildegoma "gildegoma (2 commits)")[![gnutix](https://avatars.githubusercontent.com/u/310134?v=4)](https://github.com/gnutix "gnutix (2 commits)")[![core23](https://avatars.githubusercontent.com/u/3440437?v=4)](https://github.com/core23 "core23 (2 commits)")[![richardfullmer](https://avatars.githubusercontent.com/u/384602?v=4)](https://github.com/richardfullmer "richardfullmer (2 commits)")[![pborreli](https://avatars.githubusercontent.com/u/77759?v=4)](https://github.com/pborreli "pborreli (1 commits)")

---

Tags

releaseversionsemantic versioningvcs tagpre-releasepost-release

### Embed Badge

![Health badge](/badges/liip-rmt/health.svg)

```
[![Health](https://phpackages.com/badges/liip-rmt/health.svg)](https://phpackages.com/packages/liip-rmt)
```

###  Alternatives

[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19562.3M1.3k](/packages/drupal-core)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6939.5M343](/packages/drupal-core-recommended)[kimai/kimai

Kimai - Time Tracking

4.6k7.4k1](/packages/kimai-kimai)[shivas/versioning-bundle

Symfony application versioning, simple console command to manage version (with providers e.g. git tag) of your application using Semantic Versioning 2.0.0 recommendations

1121.2M1](/packages/shivas-versioning-bundle)[bonndan/release-manager

Release Manager for semantic version releases of composer packages and projects.

2619.5k](/packages/bonndan-release-manager)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
