name: Sync Datasets to Hugging Face

on:
  release:
    types: [published]
  workflow_dispatch:

jobs:
  sync:
    concurrency:
      group: sync-datasets
      cancel-in-progress: false
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v6

      - uses: astral-sh/setup-uv@v7

      - name: Set up Python
        uses: actions/setup-python@v6
        with:
          python-version: "3.13.11"

      - name: Sync environment
        run: uv sync

      - name: Upload benchmark datasets to Hugging Face
        env:
          HF_TOKEN: ${{ secrets.HF_TOKEN }}
        run: uv run python scripts/upload_benchmark_datasets.py --repo-id ${{ secrets.HF_DATASET_REPO_ID }}
