sqlx_migrator 0.18.0

Migrator for writing sqlx migration using Rust instead of SQL
Documentation
name: Publish
on:
  push:
    tags:
      - "v*"

permissions:
  contents: write

jobs:
  publish_crate:
    name: Publish to crates.io
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4
      - name: Setup rust toolchain
        uses: dtolnay/rust-toolchain@stable
      - name: Publish to crates.io
        env:
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
        run: |
          cargo publish --all-features

  publish_release_note:
    name: Publish release note
    runs-on: ubuntu-latest
    needs: publish_crate

    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - name: Generate a changelog
        uses: orhun/git-cliff-action@v3
        id: git-cliff
        with:
          config: cliff.toml
          args: -vv --current --strip header
        env:
          OUTPUT: CHANGELOG.md
      - name: Create GitHub release
        uses: softprops/action-gh-release@v2
        with:
          body_path: ${{ steps.git-cliff.outputs.changelog }}