# Release Please — automated changelog + version bumps on merge to main.
#
# How it works:
#   1. On every push to main, release-please scans conventional commits since
#      the last release tag for each tracked package.
#   2. It opens (or updates) a single rolling "release PR" containing:
#        - version bumps in each affected package.json
#        - new CHANGELOG.md entries grouped by section (Features / Bug Fixes
#          / Performance / Refactoring / Documentation / Reverts)
#        - updated .release-please-manifest.json
#   3. Merging that PR triggers tag creation (`template-vN.N.N`, `auth-vN.N.N`,
#      etc.) and GitHub release notes.
#
# Hybrid versioning (ADR-021): root template versions independently from the
# 5 feature packages. Tags use the per-package component prefix so they don't
# collide (e.g. `template-v0.2.0` vs `auth-v0.1.1`).
#
# Tracked packages, manifest baseline, and changelog sections live in
# `release-please-config.json` + `.release-please-manifest.json`.

name: Release Please

on:
  push:
    branches: [main]

permissions:
  contents: write
  pull-requests: write

# A second push to main while a release PR is open shouldn't fight with the
# first invocation — release-please-action already updates the rolling PR
# idempotently, but concurrency keeps the audit trail clean.
concurrency:
  group: release-please
  cancel-in-progress: false

jobs:
  release-please:
    runs-on: ubuntu-latest
    steps:
      - uses: googleapis/release-please-action@v4
        with:
          config-file: release-please-config.json
          manifest-file: .release-please-manifest.json
          token: ${{ secrets.GITHUB_TOKEN }}
