elegasoft/product-version

Package for managing the semver for the repository

v0.0.1 2022-12-20 21:00 UTC

This package is auto-updated.

Last update: 2024-10-21 01:17:31 UTC


README

Latest Version on Packagist Total Downloads GitHub Actions

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.