name: Continuous Deployment

on:
  push:
    tags:
      - "v*.*.*"

jobs:
  generate-changelog:
    name: Generate changelog
    runs-on: ubuntu-22.04
    outputs:
      release_body: ${{ steps.git-cliff.outputs.content }}
    steps:
      - name: Checkout
        uses: actions/checkout@v6
        with:
          fetch-depth: 0

      - name: Generate a changelog
        uses: orhun/git-cliff-action@main
        id: git-cliff
        with:
          config: pyproject.toml
          args: -vv --latest --strip header
        env:
          OUTPUT: docs/CHANGELOG.rst
