From 880a54d2c22414bde983610ecfa58c3c971f9f5a Mon Sep 17 00:00:00 2001 From: "Max P." Date: Wed, 30 Apr 2025 12:03:04 +0200 Subject: [PATCH] feat(ci): add GitHub Actions workflow for build and publish - Set up workflow triggered by changes to pyproject.toml or manually - Install dependencies, build package, and publish to Gitea registry - Use secrets for authentication during deployment Signed-off-by: Max P. --- .github/workflows/build-and-deploy.yml | 42 ++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/build-and-deploy.yml diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml new file mode 100644 index 0000000..f373360 --- /dev/null +++ b/.github/workflows/build-and-deploy.yml @@ -0,0 +1,42 @@ +name: Build and Publish + +on: + push: + paths: + - "pyproject.toml" # Nur bei Änderungen an dieser Datei + workflow_dispatch: # Manuelles Anstoßen zulassen + +jobs: + build-and-publish: + runs-on: ubuntu-22.04 + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: 🐍 Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install Poetry + run: | + pip install poetry + + - name: Install Project Dependencies + working-directory: . + run: | + poetry install + + - name: Build Package + working-directory: . + run: | + poetry build + + - name: Publish to Gitea Package Registry + working-directory: . + env: + TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} + TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} + run: | + poetry run twine upload --repository-url ${{ secrets.TWINE_URL }} dist/*