{"id":13623150,"url":"https://github.com/liip/RMT","last_synced_at":"2025-04-15T14:32:03.564Z","repository":{"id":4575221,"uuid":"5716839","full_name":"liip/RMT","owner":"liip","description":"RMT is a handy tool to help releasing new version of your software","archived":false,"fork":false,"pushed_at":"2025-03-26T21:35:25.000Z","size":984,"stargazers_count":454,"open_issues_count":25,"forks_count":47,"subscribers_count":59,"default_branch":"main","last_synced_at":"2025-04-09T02:46:35.426Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://liip.ch","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/liip.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-09-07T13:00:50.000Z","updated_at":"2025-03-26T21:35:28.000Z","dependencies_parsed_at":"2022-09-21T18:12:19.181Z","dependency_job_id":"bfeb4c69-beb9-471d-9d8c-3b6bbcade275","html_url":"https://github.com/liip/RMT","commit_stats":{"total_commits":409,"total_committers":38,"mean_commits":"10.763157894736842","dds":"0.43031784841075793","last_synced_commit":"f98985fac701ef4a576657e6c428b5103f60cda2"},"previous_names":[],"tags_count":57,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liip%2FRMT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liip%2FRMT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liip%2FRMT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liip%2FRMT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liip","download_url":"https://codeload.github.com/liip/RMT/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249088919,"owners_count":21210883,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T21:01:28.672Z","updated_at":"2025-04-15T14:32:03.239Z","avatar_url":"https://github.com/liip.png","language":"PHP","readme":"RMT - Release Management Tool\n=============================\n\n[![Build Status](https://github.com/liip/rmt/actions/workflows/ci.yml/badge.svg)](https://github.com/liip/rmt/actions/workflows/ci.yml)\n[![Latest Stable Version](https://poser.pugx.org/liip/RMT/version.png)](https://packagist.org/packages/liip/RMT)\n[![Total Downloads](https://poser.pugx.org/liip/RMT/d/total.png)](https://packagist.org/packages/liip/RMT)\n[![License](https://poser.pugx.org/liip/rmt/license.svg)](https://packagist.org/packages/liip/rmt)\n\nRMT is a handy tool to help releasing new versions of your software. You can define the type\nof version generator you want to use (e.g. semantic versioning), where you want to store\nthe version (e.g. in a changelog file or as a VCS tag) and a list of actions that should be\nexecuted before or after the release of a new version.\n\nInstallation\n------------\n### Option 1: As a development dependency of your project\nIn order to use RMT in your project you should use [Composer](http://getcomposer.org/) to install it\nas a dev-dependency. Just go to your project's root directory and execute:\n\n    composer require --dev liip/rmt\n\nThen you must initialize RMT by running the following command:\n\n    php vendor/liip/rmt/command.php init\n\nThis command will create a `.rmt.yml` config file and a `RMT` executable script in your project's\nroot folder. You can now start using RMT by executing:\n\n    ./RMT\n\nOnce there, your best option is to pick one of the [configuration examples](#configuration-examples) below\nand adapt it to your needs.\n\nIf you are using a versioning tool, we recommend to add both Composer files (`composer.json`\nand `composer.lock`), the RMT configuration file(`.rmt.yml`) and the `RMT` executable script\nto it. The `vendor` directory should be ignored as it is populated when running\n`composer install`.\n\n### Option 2: As a global Composer installation\n\nYou can add RMT to your global composer.json and have it available globally for all your projects. Therefor\njust run the following command:\n\n    composer global require liip/rmt\n\nMake sure you have `~/.composer/vendor/bin/` in your $PATH.\n\n### Option 3: As a Phar file\nRMT 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.\n\nIf you have phar-composer installed, you can run:\n\n    sudo phar-composer install liip/RMT\n\nand 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\n\n    phar-composer build liip/RMT\n\nand 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\ndirectly `./rmt.phar` or run it by invoking it through PHP via `php rmt.phar`.\n\nFor the usage substitute RMT with whatever variant you have decided to use.\n\n### Option 4: As Drifter role\nIf your are using https://github.com/liip/drifter for your project, you just need three step\n* Activate the `rmt` role\n* Re-run the provisionning `vagrant provision`\n* Init RMT for your project `php /home/vagrant/.config/composer/vendor/liip/rmt/RMT`\n\nUsage\n-----\nUsing RMT is very straightforward, just run the command:\n\n    ./RMT release\n\nRMT will then execute the following tasks:\n\n1. Execute the prerequisites checks\n2. Ask the user to answers potentials questions\n3. Execute the pre-release actions\n4. Release\n    * Generate a new version number\n    * Persist the new version number\n5. Execute the post-release actions\n\nHere is an example output:\n\n![screenshot](https://github.com/liip/RMT/raw/master/docs/output-example.png \"First stable for RMT\")\n\n\n### Additional commands\n\nThe `release` command provides the main behavior of the tool, additional some extra commands are available:\n\n* `current` will show your project current version number (alias version)\n* `changes` display the changes that will be incorporated in the next release\n* `config` display the current config (already merged)\n* `init` create (or reset) the .rmt.yml config file\n\n\nConfiguration\n-------------\n\nAll RMT configurations have to be done in `.rmt.yml`. The file is divided in six root elements:\n\n* `vcs`: The type of VCS you are using, can be `git`, `svn` or `none`\n    * For `git` VCS you can use the two following options `sign-tag` and `sign-commit` if you want to GPG sign your release\n* `prerequisites`: A list `[]` of prerequisites that must be matched before starting the release process\n* `pre-release-actions`: A list `[]` of actions that will be executed before the release process\n* `version-generator`: The generator to use to create a new version (mandatory)\n* `version-persister`: The persister to use to store the versions (mandatory)\n* `post-release-actions`: A list `[]` of actions that will be executed after the release\n\nAll entries of this config work the same. You have to specify the class you want to handle the action. Example:\n\n    version-generator: \"simple\"`\n    version-persister:\n       vcs-tag:\n           tag-prefix: \"v_\"\n\nRMT also support JSON configs, but we recommend using YAML.\n\n### Branch specific config\n\nSometimes you want to use a different release strategy according to the VCS branch, e.g. you want to add CHANGELOG entries only in the `master` 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\nbranch `master`. Example:\n\n    _default:\n        version-generator: \"simple\"\n        version-persister: \"vcs-tag\"\n    master:\n        pre-release-actions: [changelog-update]\n\nYou can use the command `RMT config` to see the merge result between _default and your current branch.\n\n### Version generator\n\nBuild-in version number generation strategies.\n\n* simple: This generator is doing a simple increment (1,2,3...)\n* semantic: A generator which implements [Semantic versioning](http://semver.org)\n    * Option `allow-label` (boolean): To allow adding a label on a version (such as -beta, -rcXX)  (default: *false*)\n    * Option `type`: to force the version type\n    * Option `label`: to force the label\n\n    The two forced option could be very useful if you decide that a given branch is dedicated to the next beta of a\n    given version. So just force the label to beta and all release are going to be beta increments.\n\n### Version persister\n\nClass in charge of saving/retrieving the version number.\n\n* vcs-tag: Save the version as a VCS tag\n    * Option `tag-pattern`: Allow to provide a regex that all tag must match. This allow for example to release a version 1.X.X in a specific branch and to release a 2.X.X in a separate branch\n    * Option `tag-prefix`: Allow to prefix all VCS tag with a string. You can have a numeric versionning 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...\n\n* changelog: Save the version in the changelog file\n    * Option `location`: Changelog file name an location (default: *CHANGELOG*)\n\n### Prerequisite actions\n\nPrerequisite actions are executed before the interactive part.\n\n* `working-copy-check`: check that you don't have any VCS local changes\n  * Option `allow-ignore`: allow the user to skip the check when doing a release with `--ignore-check`\n* `display-last-changes`: display your last changes\n* `tests-check`: run the project test suite\n  * Option `command`: command to run (default: *phpunit*)\n  * Option `timeout`: the number of seconds after which the command times out (default: *60.0*)\n  * Option `expected_exit_code`: expected return code (default: *0*)\n* `composer-json-check`: run a validate on the composer.json\n  * Option `composer`: how to run composer (default: *php composer.phar*)\n* `composer-stability-check`: will check if the composer.json is set to the right minimum-stability\n  * Option `stability`: the stability that should be set in the minimum-stability field (default: *stable*)\n* `composer-security-check`: run the composer.lock against https://github.com/fabpot/local-php-security-checker to check for known vulnerabilities in the dependencies. ⚠️ The local-php-security-checker binary must be installed globally.\n* `composer-dependency-stability-check`: test if only allowed dependencies are using development versions\n    * Option `ignore-require` and `ignore-require-dev`: don't check dependencies in `require` or `require-dev` section\n    * Option `whitelist`: allow specific dependencies to use development version\n* `command`: Execute a system command\n    * Option `cmd` The command to execute\n    * Option `live_output` boolean, do we display the command output? (default: *true*)\n    * Option `timeout` integer, limits the time for the command. (default: *600*)\n    * Option `stop_on_error` boolean, do we break the release process on error? (default: *true*)\n\n### Actions\n\nActions can be used for pre or post release parts.\n\n* `changelog-update`: Update a changelog file. This action is further configured\n  to use a specific formatter.\n    * Option `format`: *simple*, *semantic*, *markdown* or *addTop*  (default: *simple*)\n    * Option `file`: path from .rmt.yml to changelog file (default: *CHANGELOG*)\n    * Option `dump-commits`: write all commit messages since the last release into the\n      changelog file (default: *false*)\n    * Option `insert-at`: only for addTop formatter: Number of lines to skip from the\n      top of the changelog file before adding the release number (default: *0*)\n    * Option `exclude-merge-commits`: Exclude merge commits from the changelog (default: *false*)\n* `vcs-commit`: commit all files of the working copy (only use it with the\n  `working-copy-check` prerequisite)\n    * Option `commit-message`: specify a custom commit message. %version% will be replaced by the current / next version strings.\n* `vcs-tag`: Tag the last commit\n* `vcs-publish`: Publish the changes (commits and tags)\n* `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 handle by version control tags)\n* `files-update`: Update the version in one or multiple files. For each file to update, please provide an array with \n    * Option `file`: path to the file to update\n    * Option `pattern`: optional, use to specify the string replacement pattern in your file. For example: \n    `const VERSION = '%version%';`\n* `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\n    * Option `package-name`: the name of the generate package\n    * Option `destination`: the destination directory to build the package into. If prefixed with a slash, is considered absolute, otherwise relative to the project root.\n    * 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`\n    * 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. \n    * Option `default-stub-cli`: the default stub for CLI usage of the package.\n    * Option `default-stub-web`: the default stub for web application usage of the package.\n* `command`: Execute a system command\n    * Option `cmd` The command to execute\n    * Option `live_output` boolean, do we display the command output? (default: *true*)\n    * Option `timeout` integer, limits the time for the command. (default: *600*)\n    * Option `stop_on_error` boolean, do we break the release process on error? (default: *true*)\n* `update-version-class`: Update the version constant in a class file. DEPRECATED, use `files-update` instead\n    * Option `class`: path to class to be updated, or fully qualified class name of the class containing the version constant\n    * Option `pattern`: optional, use to specify the string replacement pattern in your\n      version class. %version% will be replaced by the current / next version strings.\n      For example you could use `const VERSION = '%version%';`. If you do not specify\n      this option, every occurrence of the version string in the file will be replaced.\n\n\nExtend it\n---------\n\nRMT 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:\n\n    version-generator: \"bin/myOwnGenerator.php\"\n\nExample with injected parameters:\n\n    version-persister:\n        name: \"bin/myOwnGenerator.php\"\n        parameter1: value1\n\nAs 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).\n\n*WARNING:* As the key `name` is used to define the name of the object, you cannot have a parameter named `name`.\n\n\nConfiguration examples\n----------------------\nMost of the time, it will be easier for you to pick up an example below and adapt it to your needs.\n\n### No VCS, changelog updater only\n\n    version-generator: semantic\n    version-persister: changelog\n\n### Using Git tags, simple versioning and prerequisites\n\n    vcs: git\n    version-generator: simple\n    version-persister: vcs-tag\n    prerequisites: [working-copy-check, display-last-changes]\n    \n### Using Git tags, simple versioning and composer-prerequisites\n\n    vcs: git\n    version-generator: simple\n    version-persister: vcs-tag\n    prerequisites:\n        - composer-json-check\n        - composer-stability-check:\n            stability: beta\n        - composer-dependency-stability-check:\n            whitelist:\n                - [symfony/console]\n                - [phpunit/phpunit, require-dev]\n    \n### Using Git tags, simple versioning and prerequisites, and gpg sign commit and tags\n\n    vcs: \n      name: git\n      sign-tag: true\n      sign-commit: true\n    version-generator: simple\n    version-persister: vcs-tag\n    prerequisites: [working-copy-check, display-last-changes]\n\n\n### Using Git tags with prefix, semantic versioning, updating two files and pushing automatically\n\n    vcs: git\n    version-generator: semantic\n    version-persister:\n        name: vcs-tag\n        tag-prefix : \"v_\"\n    pre-release-actions:\n        files-update:\n            - [config.yml]\n            - [app.ini, 'dynamic-version: %version%']\n    post-release-actions: [vcs-publish]\n\n### Using semantic versioning on master and simple versioning on topic branches, markdown formatting for changelog\n\n    _default:\n        vcs: git\n        prerequisites: [working-copy-check]\n        version-generator: simple\n        version-persister:\n            name: vcs-tag\n            tag-prefix: \"{branch-name}_\"\n        post-release-actions: [vcs-publish]\n\n    # This entry allow to override some parameters for the master branch\n    master:\n        prerequisites: [working-copy-check, display-last-changes]\n        pre-release-actions:\n            changelog-update:\n                format: markdown\n                file: CHANGELOG.md\n                dump-commits: true\n            update-version-class:\n                class: Doctrine\\ODM\\PHPCR\\Version\n                pattern: const VERSION = '%version%';\n            vcs-commit: ~\n        version-generator: semantic\n        version-persister: vcs-tag\n\nContributing\n------------\nIf you would like to help, by submitting one of your action scripts, generators, or persisters. Or just by reporting a \nbug just go to the project page [https://github.com/liip/RMT](https://github.com/liip/RMT).\n\nIf you provide a PR, try to associate it some unit or functional tests. See next section\n\nTests\n-----\n\n### Requirements\n\nTo be able to run the tests locally, you need:\n* phpunit\n* git\n* mercurial\n\nYou can install all of them with Brew:\n\n    \u003e brew install phpunit git hg\n\nThe tests are also testing the creation of the RMT phar. So you \nhave to allow this in your php.ini, by uncommenting this line:\n\n    phar.readonly = Off\n\nFinally, to run the tests, just launch PHPUnit\n\n    \u003e phpunit\n\n### Functional tests\n\nThe functional tests are fully functional temporary RMT setup. Each time you run functional test, it creates a temporary\nfolder with a RMT project. Then the test suite is running RMT commands on it, and check the results. That's why you need\nto have Git and Mercurial installed. \n\n#### Debug\n\nTo debug RMT functional tests, the best is to go into this temporary folder and manually explore the project. To do so, \njust add a small `$this-\u003emanualDebug();` into the test suite. This will break the test with the following output:\n\n    MANUAL DEBUG Go to:\n    \u003e cd /private/var/folders/hl/gnj5dcj55gbc93pcgrjxbb0w0000gn/T/ceN2Mf\n\nThen you just have to go into the mentioned folder and start debugging\n\nAuthors\n-------\n\n* Jonathan Macheret, Liip SA\n* David Jeanmonod Liip SA\n* and [others contributors](https://github.com/liip/RMT/graphs/contributors)\n\nLicense\n-------\n\nRMT is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n","funding_links":[],"categories":["杂项","杂项 Miscellaneous","目录","Table of Contents","PHP","Miscellaneous","Configuration"],"sub_categories":["构建工具 Build Tools","Build Tools","Miscellaneous"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliip%2FRMT","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliip%2FRMT","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliip%2FRMT/lists"}