misodrobny / application-versioning
Laravel package for application versioning in your application with ease.
Fund package maintenance!
Michal Drobny
Requires
- php: ^8.3
- spatie/laravel-package-tools: ^1.16
- symfony/yaml: ^7.1
Requires (Dev)
- larastan/larastan: ^2.9
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/testbench: ^9.0.0||^8.22.0
- pestphp/pest: ^2.34
- pestphp/pest-plugin-arch: ^2.7
- pestphp/pest-plugin-laravel: ^2.3
- phpstan/extension-installer: ^1.3
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-phpunit: ^1.3
- spatie/laravel-ray: ^1.35
README
This package will help to manage version of your application. It will create version.yaml file in root of your project and you can manage version of your application in this file.
For more about application versioning please follow Semantic Versioning
Installation
You can install the package via composer:
composer require misodrobny/application-versioning
After installation, you need to run install script which will publish config file and create default version.yaml file.
php artisan application-versioning:install
This is the contents of the published config file:
return [ 'version_file_path' => base_path('version.yaml'), ];
Initial formated version has following structure:
$major.$minor.$patch - $git_hash
$git_hash
contains 7 characters long GIT HASH from current git commit.
Usage
For getting version of your application you can use facade ApplicationVersion
echo ApplicationVersion::getFormatedVersion();
To increase version of your application you can use following methods:
(new ApplicationVersioning)->increaseMajor(); (new ApplicationVersioning)->increaseMinor(); (new ApplicationVersioning)->increasePatch();
It is also possible to run
php artisan application-version:increase-major php artisan application-version:increase-minor php artisan application-version:increase-patch
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.