From aef6a24dc0b77df41623d6f88512931b2822ef30 Mon Sep 17 00:00:00 2001 From: Florian Date: Sat, 8 Nov 2025 11:27:31 +0100 Subject: [PATCH] Added PyPi package build process --- .gitea/workflows/build-local.yaml | 25 +++++++++++++++++++++++++ .gitea/workflows/build.yaml | 25 +++++++++++++++++++++++++ pyproject.toml | 2 +- 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 .gitea/workflows/build-local.yaml create mode 100644 .gitea/workflows/build.yaml diff --git a/.gitea/workflows/build-local.yaml b/.gitea/workflows/build-local.yaml new file mode 100644 index 0000000..6cd4ab6 --- /dev/null +++ b/.gitea/workflows/build-local.yaml @@ -0,0 +1,25 @@ +name: Build and Publish Package + +on: + workflow_dispatch: + +jobs: + build: + runs-on: local + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Prepare environment + run: | + virtualenv -p python3 .venv + source .venv/bin/activate + pip install build twine + - name: Build package + run: .venv/bin/python -m build + - name: Publish package + run: | + .venv/bin/python -m twine upload \ + --repository-url https://git.gansejunge.com/api/packages/notifier/pypi \ + -u ${{ secrets.PACKAGE_UPLOAD_USERNAME }} \ + -p ${{ secrets.PACKAGE_UPLOAD_TOKEN }} \ + dist/* \ No newline at end of file diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml new file mode 100644 index 0000000..7f5fb96 --- /dev/null +++ b/.gitea/workflows/build.yaml @@ -0,0 +1,25 @@ +name: Build and Publish Package + +on: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Prepare environment + run: | + virtualenv -p python3 .venv + source .venv/bin/activate + pip install build twine + - name: Build package + run: .venv/bin/python -m build + - name: Publish package + run: | + .venv/bin/python -m twine upload \ + --repository-url https://git.gansejunge.com/api/packages/notifier/pypi \ + -u ${{ secrets.PACKAGE_UPLOAD_USERNAME }} \ + -p ${{ secrets.PACKAGE_UPLOAD_TOKEN }} \ + dist/* \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index aaf2a16..42457cd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ dependencies = ["simple-logger-handler @ git+https://git.gansejunge.com/notifier encryption = ["cryptography==46.0.2"] [build-system] -requires = ["setuptools>=61"] +requires = ["setuptools>=61", "wheel"] build-backend = "setuptools.build_meta" [project.urls]