From e13a37c193f697023e98ba3c0edcc3de87417caf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dni=20=E2=9A=A1?= Date: Wed, 17 Apr 2024 10:53:57 +0200 Subject: [PATCH] FEAT: add PYPI python package release workflow on tag (#1628) * add pypi worflow, pyproject types, package metadata, ignore python package build, docker build fails if poetry uses readme for python package * add pypi to release --- .dockerignore | 1 + .github/workflows/release.yml | 10 ++++++++++ .gitignore | 3 +++ pyproject.toml | 7 +++++++ 4 files changed, 21 insertions(+) diff --git a/.dockerignore b/.dockerignore index e34785c0b..7e3cbdb12 100644 --- a/.dockerignore +++ b/.dockerignore @@ -9,6 +9,7 @@ lnbits/static/bundle.js lnbits/static/bundle.css *.md +!README.md *.log .env diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4b79df8ca..9721cd04f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,6 +10,7 @@ permissions: contents: write jobs: + release: runs-on: ubuntu-latest steps: @@ -29,3 +30,12 @@ jobs: secrets: DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + + pypi: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Build and publish to pypi + uses: JRubics/poetry-publish@v1.15 + with: + pypi_token: ${{ secrets.PYPI_API_KEY }} diff --git a/.gitignore b/.gitignore index dd8cde71c..9e661381a 100644 --- a/.gitignore +++ b/.gitignore @@ -51,3 +51,6 @@ lnbits-backup.zip # Ignore extensions (post installable extension PR) extensions upgrades/ + +# builded python package +dist diff --git a/pyproject.toml b/pyproject.toml index 9bfe4df01..36af1dd3b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,6 +3,13 @@ name = "lnbits" version = "0.12.6" description = "LNbits, free and open-source Lightning wallet and accounts system." authors = ["Alan Bits "] +readme = "README.md" +repository = "https://github.com/lnbits/lnbits" +homepage = "https://lnbits.com" +packages = [ + {include = "lnbits"}, + {include = "lnbits/py.typed"}, +] [tool.poetry.dependencies] python = "^3.10 | ^3.9"