name: Prepare Release Crates

on:
  workflow_dispatch:

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  check:
    name: Check
    runs-on: ubuntu-latest
    steps:
      - uses: taiki-e/checkout-action@v1
      - uses: Boshen/setup-rust@main
        with:
          cache-key: warm
          tools: cargo-release-oxc
      - run: cargo ck
      - run: cargo release-oxc publish --release crates --dry-run

  prepare:
    needs: check
    name: Prepare Release Crates
    uses: ./.github/workflows/reusable_prepare_release.yml
    with:
      name: crates
    secrets:
      OXC_BOT_PAT : ${{ secrets.OXC_BOT_PAT }}
