Eric's Blog 时光荏苒,岁月如梭

Github 仓库自动 release

2025-09-22
Eric Wong

因为仓库比较多(比较懒),不想每次都手动发布版本,写项目版本更新的内容,因此给自己的每一个仓库引入了 googleapis/release-please-action

在仓库的根目录新建文件:.github/workflows/release-please.yml

on:
  push:
    branches:
      - master

permissions:
  issues: write
  contents: write
  pull-requests: write

name: release-please

jobs:
  release-please:
    runs-on: ubuntu-latest
    steps:
      - uses: googleapis/release-please-action@v4
        with:
          # this assumes that you have created a personal access token
          # (PAT) and configured it as a GitHub action secret named
          # `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important).
          token: $
          # this is a built-in strategy in release-please, see "Action Inputs"
          # for more options
          release-type: simple

然后,给仓库的 Github Action 添加权限,勾选 “Allow GitHub Actions to create and approve pull requests”,在仓库的 Settings > Actions > General。

完成以上步骤以后,书写 Git commit 时,需要遵循 Conventional Commits


版权声明:本文为原创文章,遵循 署名-非商业性使用-禁止演绎 4.0 国际 (CC BY-NC-ND 4.0)版权协议,转载请附上原文出处链接和本声明。


分享到:

评论

目录