zenstack/.github/workflows/bump-version.yml
Yiming Cao 67bb5ab8ec
feat: split bump-version into bump-patch and bump-minor commands (#538)
- Updated GitHub Actions workflow to accept version_type input (patch/minor)
- Modified bump-version.ts script to support both patch and minor version increments
  - Patch: increments patch version (e.g., 3.0.5 → 3.0.6)
  - Minor: increments minor version and resets patch to 0 (e.g., 3.0.5 → 3.1.0)
- Replaced single bump-version command with two separate commands:
  - bump-patch: triggers workflow with version_type=patch
  - bump-minor: triggers workflow with version_type=minor

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-28 12:19:03 +08:00

54 lines
1.5 KiB
YAML

name: Bump Version
on:
workflow_dispatch:
inputs:
version_type:
description: 'Version type to bump'
required: true
type: choice
options:
- patch
- minor
permissions:
contents: write
pull-requests: write
jobs:
bump-version:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/dev'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: dev
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 10.12.1
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Bump version
id: bump
run: npx tsx scripts/bump-version.ts ${{ inputs.version_type }}
- name: Create PR
uses: peter-evans/create-pull-request@v7
with:
commit-message: 'chore: bump version ${{ steps.bump.outputs.new_version }}'
title: '[CI] Bump version ${{ steps.bump.outputs.new_version }}'
body: Automated changes for bumping version
branch: chore/ci-bump-version
branch-suffix: timestamp