Skip to content

chore: merge branch 'Ci/update-github-action' #28

chore: merge branch 'Ci/update-github-action'

chore: merge branch 'Ci/update-github-action' #28

Workflow file for this run

name: Bump version
on:
push:
branches:
- master
- main
workflow_dispatch:
inputs:
increment:
description: 'Version increment (major, minor, patch)'
required: false
type: choice
options:
- major
- minor
- patch
default: patch
permissions:
contents: write # 用于创建和推送标签
pull-requests: write # 用于创建 PR
jobs:
bump-version:
if: "!startsWith(github.event.head_commit.message, 'bump:')"
runs-on: ubuntu-latest
name: "Bump version and create changelog with commitizen"
steps:
- name: Check out
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ github.token }}
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Install dependencies
run: uv sync --extra=dev
- id: cz
name: Create bump and changelog
uses: commitizen-tools/commitizen-action@master
with:
github_token: ${{ github.token }}
changelog_increment_filename: body.md
increment: ${{ github.event.inputs.increment }}
- name: Create Release
uses: softprops/action-gh-release@v2
with:
body_path: body.md
tag_name: ${{ env.REVISION }}
env:
GITHUB_TOKEN: ${{ github.token }}