name: Release Please

on:
  push:
    branches:
      - main

permissions:
  contents: write
  pull-requests: write

jobs:
  release-please:
    runs-on: ubuntu-latest
    steps:
      - uses: googleapis/release-please-action@v4
        with:
          # 优先使用 PAT：如果 GITHUB_TOKEN 无权创建 PR，创建一个 classic PAT
          # 授予 repo 权限，添加到仓库 Secrets → RELEASE_PLEASE_TOKEN
          token: ${{ secrets.RELEASE_PLEASE_TOKEN || secrets.GITHUB_TOKEN }}
          config-file: release-please-config.json
          manifest-file: .release-please-manifest.json
