version: "3"

tasks:
  build:
    cmds:
      - poetry build

  clean:
    cmds:
      - git clean -d --force -X

  dist:
    cmds:
      - bash scripts/dist.sh "{{OS}}" "{{ARCH}}" "{{.PYTHON_VERSION}}" "{{exeExt}}"
    vars:
      PYTHON_VERSION:
        sh: python scripts/python_version.py

  publish:
    cmds:
      - poetry publish --build

  run:
    cmds:
      - OPENSSL_CONF="openssl.cnf" tld

  setup:
    cmds:
      - micromamba --yes --name="thu-learn-downloader" create libpython-static python=3.11
      - micromamba --yes --name="thu-learn-downloader" run poetry install
