elegasoft / product-version
Package for managing the semver for the repository
Requires
- php: ^7.4|^8.0
- illuminate/support: ^8.0|^9.0|^10.0
- symfony/process: *
Requires (Dev)
- orchestra/testbench: ^6.0
- phpunit/phpunit: ^9.0
README
A package to display the latest git tag version and will also allow you to easily and/or programmatically bump the major, minor and patch tags for the repository.
# Basic Semver Looks Like:
{major}.{minor}.{patch}
Installation
You can install the package via composer:
composer require elegasoft/product-version
Usage (Command Line/Console)
To see the current semver version of the repository
php artisan product-version:current
# Output Example: v1.0.3-125-0ca4a7187
The default is to bump the patch version of the semver
# Starting with: v1.0.3-125-0ca4a7187 php artisan product-version:bump # Output Example: v1.0.4-125-0ca4a7187
To bump the major semver version of the repository
# Starting with: v1.0.3-125-0ca4a7187 php artisan product-version:bump --major # Output Example: v2.0.0-125-0ca4a7187
To bump the minor semver version of the repository
# Starting with: v1.0.3-125-0ca4a7187 php artisan product-version:bump --minor # Output Example: v1.1.0-125-0ca4a7187
Usage (Programmatic)
To see the current semver version of the repository
ProductVersion::current(); // Output Example: v1.0.3-125-0ca4a7187
The default is to bump the patch version of the semver
// Starting w: v1.0.3-125-0ca4a7187 ProductVersion::bump(); // Output Example: v1.0.4-125-0ca4a7187
To bump the major semver version of the repository
// Starting w: v1.0.3-125-0ca4a7187 ProductVersion::bump($major = true, $minor = false); // Output Example: v2.0.0-125-0ca4a7187
To bump the minor semver version of the repository
// Starting w: v1.0.3-125-0ca4a7187 ProductVersion::bump($major = false, $minor = true); // Output Example: v1.1.0-125-0ca4a7187
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email jason@elegasoft.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.