name: First Release to PyPI

on:
  workflow_dispatch:  # 手动触发

jobs:
  release:
    runs-on: ubuntu-24.04
    defaults:
      run:
        working-directory: bot
    steps:
      - uses: actions/checkout@v6

      - uses: actions/setup-python@v6
        with:
          python-version: '3.11'

      - name: Install build dependencies
        run: pip install build

      - name: Build package
        run: python -m build

      - name: Publish to PyPI
        uses: pypa/gh-action-pypi-publish@release/v1
        with:
          password: ${{ secrets.VIKINGBOT_PYPI_API_TOKEN }}
          packages-dir: bot/dist/
