diff --git a/.github/workflows/pip-publish.yml b/.github/workflows/pip-publish.yml index 4d8ed59..2d6c78e 100644 --- a/.github/workflows/pip-publish.yml +++ b/.github/workflows/pip-publish.yml @@ -1,31 +1,30 @@ -name: Upload Python Package +name: Publish to PyPI on: push: - paths: - - ai_traineree/__init__.py - branches: - - "master" - - "ci-test" + tags: + - "v*.*.*" jobs: deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 + - name: Checkout + uses: actions/checkout@v2 + + - name: Install uv + uses: astral-sh/setup-uv@v5 + with: # Latest on 2024-12-28 + version: "0.5.13" + + - name: "Set up Python" + uses: actions/setup-python@v5 with: - python-version: "3.x" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install build + python-version-file: ".python-version" + - name: Build package - run: python -m build + run: uv build + - name: Publish package - uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 - with: - user: __token__ - password: ${{ secrets.AI_TRAINEREE_PYPI_API_TOKEN }} + run: uv publish diff --git a/Taskfile.dist.yaml b/Taskfile.dist.yaml index 9a622fe..2bc2b43 100644 --- a/Taskfile.dist.yaml +++ b/Taskfile.dist.yaml @@ -24,6 +24,11 @@ tasks: desc: "Lint the project" cmds: - uvx ruff@0.3.0 check + + build: + desc: "Build the project" + cmds: + - uv build test: cmds: diff --git a/pyproject.toml b/pyproject.toml index c71da2d..b404e5c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,6 +12,9 @@ dependencies = [ "matplotlib>=3.7.5", ] +[build-system] +requires = ["uv>=0.4.9", "hatchling"] +build-backend = "hatchling.build" [tool.uv] dev-dependencies = [