elegasoft/product-version

用于管理存储库的semver的包

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

This package is auto-updated.

Last update: 2024-09-21 01:09:34 UTC


README

Latest Version on Packagist Total Downloads GitHub Actions

一个用于显示最新git标签版本的包,同时允许您轻松地/或通过程序提升存储库的主版本、次版本和补丁标签。

# Basic Semver Looks Like:
{major}.{minor}.{patch}

安装

您可以通过composer安装此包

composer require elegasoft/product-version

使用方法(命令行/控制台)

查看存储库当前的semver版本

php artisan product-version:current

# Output Example: v1.0.3-125-0ca4a7187

默认情况下,提升semver的补丁版本

# Starting with: v1.0.3-125-0ca4a7187

php artisan product-version:bump

# Output Example: v1.0.4-125-0ca4a7187

提升存储库的major semver版本

# Starting with: v1.0.3-125-0ca4a7187

php artisan product-version:bump --major

# Output Example: v2.0.0-125-0ca4a7187

提升存储库的minor semver版本

# Starting with: v1.0.3-125-0ca4a7187

php artisan product-version:bump --minor

# Output Example: v1.1.0-125-0ca4a7187

使用方法(程序化)

查看存储库当前的semver版本

ProductVersion::current(); 

// Output Example: v1.0.3-125-0ca4a7187

默认情况下,提升semver的补丁版本

// Starting w: v1.0.3-125-0ca4a7187

ProductVersion::bump(); 

// Output Example: v1.0.4-125-0ca4a7187

提升存储库的major semver版本

// Starting w: v1.0.3-125-0ca4a7187

ProductVersion::bump($major = true, $minor = false); 

// Output Example: v2.0.0-125-0ca4a7187

提升存储库的minor semver版本

// Starting w: v1.0.3-125-0ca4a7187

ProductVersion::bump($major = false, $minor = true); 

// Output Example: v1.1.0-125-0ca4a7187

测试

composer test

变更日志

请参阅 CHANGELOG 了解最近更改的详细信息。

贡献

请参阅 CONTRIBUTING 了解详细信息。

安全

如果您发现任何安全相关的问题,请通过电子邮件 jason@elegasoft.com 反馈,而不是使用问题跟踪器。

鸣谢

许可

MIT许可(MIT)。请参阅 许可文件 了解更多信息。

Laravel包模板

此包是使用 Laravel包模板 生成的。