Skip to content

Commit

Permalink
cicd: update pypi publish script
Browse files Browse the repository at this point in the history
  • Loading branch information
laszukdawid committed Dec 28, 2024
1 parent 9d9d340 commit 28a3350
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 19 deletions.
37 changes: 18 additions & 19 deletions .github/workflows/pip-publish.yml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions Taskfile.dist.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down

0 comments on commit 28a3350

Please sign in to comment.