tendersrl/version

Automatically create git tag about your Laravel app version

v1.1.0-beta.1 2022-06-30 06:56 UTC

This package is auto-updated.

Last update: 2024-03-29 04:33:09 UTC


README

Automatically create git tag about your Laravel app version

Latest Version on Packagist Build Status StyleCI MIT licensed Total Downloads

Description

This package is a Laravel (5.5+) utility which helps you keep and manage your application version, increment version numbers (major, minor, patch, commit), and can also use your last commit hash.

This package is an extension of https://github.com/antonioribeiro/version, that let you to create automatically a git tag every time you update your app version.
Please refer to parent package to extensive documentation.

Easily increment your version numbers, using Artisan commands

php artisan version:minor

Which should ask you your commit message

$ Enter your commit message
>

Then should create a new git tag and should print the new version number

New patch: 11
MyApp version 2.6.11 (commit cb2afb64)

Available for all of them:

$ php artisan version:major   
$ php artisan version:minor   
$ php artisan version:patch   

Then you only need to push your commit and your tag:

$ git push --tags 

Formating tag

After publishing configuration, entry as tag-format the format you prefer to tag your commit.

tag-format: tag

You can also specify the tag format via the --tag-format option:

$ php artisan version:patch --tag-format=compact

Other available options

If you want to increment your app version without creating a commit or tag, you can use the --no-commit and --no-tag options

$ php artisan version:patch --no-commit --no-tag

Install

Via Composer

$ composer require tendersrl/version

Then publish the configuration file you'll have to:

$ php artisan vendor:publish --provider="TenderSrl\Version\VersionServiceProvider"

And you should be good to use it in your views:

@version

Minimum requirements

  • Laravel 5.5
  • PHP 7.0

License

This package is licensed under the MIT License