From e236b56d0eaf5151541c4fd41391225d11a3f62a Mon Sep 17 00:00:00 2001 From: George Margaritis Date: Fri, 2 Feb 2024 17:49:54 +0200 Subject: [PATCH] ci: add ci and publish workflows --- .github/workflows/ci.yml | 19 +++++++++++++++++++ .github/workflows/publish.yml | 22 ++++++++++++++++++++++ Dockerfile | 2 +- 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..6f55a8d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,19 @@ +name: CI + +on: push + +jobs: + ci: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.1.1 + - run: pipx install poetry==1.7.1 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: "poetry" + - run: poetry check + - run: poetry lock --check + - run: poetry install + - run: poetry run black --check . + - run: poetry run isort --check . diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..8f8b995 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,22 @@ +name: Publish to PyPI + +on: + release: + types: [created] + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.1.1 + - run: pipx install poetry==1.7.1 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: "poetry" + - run: poetry check + - run: poetry install + - name: Build and publish + run: | + poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }} + poetry publish --build diff --git a/Dockerfile b/Dockerfile index 1e6fe73..4218e51 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/withlogicco/poetry:1.6.1-python-3.11 +FROM ghcr.io/withlogicco/poetry:1.7.1-python-3.12 WORKDIR /usr/src/app COPY pyproject.toml poetry.lock ./