alexandre-daubois/release-genius 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

alexandre-daubois/release-genius

Composer 安装命令:

composer require alexandre-daubois/release-genius

包简介

Generate changelogs and tags from your git history

README 文档

README

PHPUnit

Conventional version screenshot

Requirements

  • PHP 8.2 or higher
  • Git

That's it!

Why this package?

This package is a simple tool to help you manage your changelog and versioning. It uses the Conventional Commits standard to generate the changelog. This standard is widely used in the open-source community and is a great way to ensure that your commit messages are understandable and easy to parse.

Unlike this package, this one is under the MIT license. This licence is more permissive than the GPL-3.0 licence. This can be a pain point for some projects, and it is the main motivation for creating Release Genius.

Installation

composer require alexandre-daubois/release-genius

Usage

TL;DR

# Initialize the package
vendor/bin/release-genius --init

# Upgrade to the next version (major, minor or patch)
# CHANGELOG.md, package.json and composer.json will be updated
vendor/bin/release-genius patch
git push && git push --tags

# Only update the changelog, composer.json and package.json
vendor/bin/release-genius patch --no-commit

Available options

Usage:
  ./release-genius [options] [--] [<release type>]

Arguments:
  release type                   The type of release to be generated (major, minor, patch)

Options:
  -f, --path=PATH                The file to write the changelog to [default: "CHANGELOG.md"]
  -m, --mode=MODE                The writing mode to use when writing the changelog to a file, between prepend, append and overwrite [default: "prepend"]
  -i, --init                     Initialize the changelog file and create a new git tag
  -r, --remote=REMOTE            The remote to push the tag to; This is also used to generate URLs in the Changelog (use "none" if you don't use a remote) [default: "origin"]
      --remote-type=REMOTE-TYPE  The type of remote to use; This is used to generate URLs in the Changelog ("github" or "gitlab")
      --skip-vendors             Skip the update of package.json and composer.json
      --no-commit                Do not create a commit and a tag, only update the changelog and vendor files if any

Initialize and upgrade the version

The first time you use the package, you may need to initialize it. This is required when you don't have any tag in your repository and no changelog file exists. You can do this by running the following command:

vendor/bin/release-genius --init

This will create a new file called CHANGELOG.md in the root of your project. Also, it will create a new tag. You will be prompted to enter the version number you want to use. The version number should follow the Semantic Versioning specification.

After the initialization, you can start using the package to manage your changelog and versioning. The package provides a few commands to help you with that. Imagine your current version is 1.0.0. You can upgrade the version by running the following command:

# Upgrade the version to 1.0.1
vendor/bin/release-genius patch

# Upgrade the version to 1.1.0
vendor/bin/release-genius minor

# Upgrade the version to 2.0.0
vendor/bin/release-genius major

This will update the CHANGELOG.md file and create a new tag. The tag will not be pushed to the remote repository. This is something you need to do manually in order to ensure you're happy with the changes and the new version.

Vendors JSON files

If a package.json file exists in the root of your project, the version number will be updated in this file as well (if present). The same goes for a composer.json file.

Skip the commit and tag creation

If you want to create the tag and commit yourself to be extra careful, you can use the --no-commit option. Release Genius will only update the changelog and the vendor JSON files.

vendor/bin/release-genius minor --no-commit

Generate a changelog

The changelog is generated thanks to your commit messages. All commits from the last tag to the current state of your repository will be used to generate it.

You can customize the output path of the changelog file by using the --path option. By default, the changelog file is created in the root of your project and is called CHANGELOG.md.

vendor/bin/release-genius minor --path=docs/CHANGELOG.md

You can also choose the way to changelog file is generated. By default, the changelog file uses the prepend mode. This means that the new content is added at the beginning of the file. You can change this behavior by using the --mode option. The available modes are append, prepend and overwrite.

vendor/bin/release-genius minor --mode=append

Manage remotes

This package will do its best to guess the remote repository URL. By default, it tries to find a remote called origin. If it fails, you can use the --remote option to specify the remote repository URL.

vendor/bin/release-genius minor --remote=upstream

This will allow to generate a changelog with the correct links to the commits and versions comparison.

In case you don't use a guessable remote URL (because your hosting a private instance of Gitlab, for example), you can use the --remote-type option to specify the type of your remote repository. The available types are github, gitlab.

vendor/bin/release-genius minor --remote-type=gitlab

Specifying the type will help generate the good URL format, with your remote URL. The remote type always takes precedence over the automatic remote URL guessing.

alexandre-daubois/release-genius 适用场景与选型建议

alexandre-daubois/release-genius 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.66k 次下载、GitHub Stars 达 5, 最近一次更新时间为 2024 年 02 月 12 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「git」 「version」 「generation」 「tag」 「semver」 「semantic」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 alexandre-daubois/release-genius 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 alexandre-daubois/release-genius 我们能提供哪些服务?
定制开发 / 二次开发

基于 alexandre-daubois/release-genius 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 3.66k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 29
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-02-12