execut/yii2-composer-release-command

Yii2 command for fast releasing and versioning composer packages

0.2.0 2020-02-18 11:00 UTC

This package is auto-updated.

Last update: 2024-04-10 18:23:56 UTC


README

This command can publish and calculate the version of the set of packages in your project at a one fast and simple run: ./yii release

Installation

The preferred way to install this extension is through composer.

Either run

$ php composer.phar require execut/yii2-composer-release-command "dev-master"

or add

"execut/yii2-composer-release-command": "dev-master"

to the require section of your composer.json file.

Configuration example

Add to console config following rules:

[
    'controllerMap' => [
        'release' => [
            'class' => \execut\release\ReleaseController::class,
            'vendorFolder' => 'execut', // Folder(s) inside @vendor for releasing, supported list 
        ],
    ],
];

Usage

All released packages must be installed with .git via --prefer-source composer flag (see composer documentation). Fast way for adding git inside installed packages:

  1. Delete them
  2. Run composer install --prefer-source for fresh install of package with git server

After running console command ./yii release the happen next operations:

  1. Each folder with .git, specified inside configuration file checked for new changes
  2. If has changes happen the next operations:
    1. git add .
    2. git pull origin master
    3. git checkout master
    4. git pull
    5. git commit with message passed via console argument --message(m) or entered inside console dialog
    6. git push
    7. Calculating and tagging new version by next rule: (major version).(minor version).(path version). Console argument --level(l) set level of calculation next version. 0 - major, 1 - minor, 2 - path (default)
    8. git push --tags

Console arguments:

Name Short name Description Default value
--message -m Commit message
--level -l level of calculated next version. 0 - major, 1 - minor, 2 - path 2

License

yii2-composer-release-command is released under the Apache License Version 2.0. See the bundled LICENSE.md for details.