From 97164df64dfc734d7386e5f58ae78700e96c0aa2 Mon Sep 17 00:00:00 2001 From: Jon Michael Aanes Date: Sun, 31 Mar 2024 22:06:22 +0200 Subject: [PATCH] Conditions --- .gitea/workflows/python-package.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/python-package.yaml b/.gitea/workflows/python-package.yaml index 223734b..8afa49b 100644 --- a/.gitea/workflows/python-package.yaml +++ b/.gitea/workflows/python-package.yaml @@ -6,11 +6,14 @@ on: PUBLISH: required: false default: false + type: boolean secrets: PIPY_REPO_USER: required: true + type: string PIPY_REPO_PASS: required: true + type: string jobs: test-and-publish: @@ -23,17 +26,21 @@ jobs: apt-get update apt-get install -y python3 python3-pip - name: Installing Python Dependencies + if: success() run: python3 -m pip install --upgrade pip setuptools wheel build twine pytest --break-system-packages - name: Check out repository code + if: success() uses: actions/checkout@v3 - name: Installing package + if: success() run: python3 -m pip install . --break-system-packages - name: Test Python Code + if: success() run: python3 -m pytest test - name: Build - if: always() && inputs.PUBLISH + if: success() && inputs.PUBLISH run: python3 -m build - name: Publish - if: always() && inputs.PUBLISH + if: success() && inputs.PUBLISH run: python3 -m twine upload --repository-url "https://gitfub.space/api/packages/${{ secrets.PIPY_REPO_USER }}/pypi" -u ${{ secrets.PIPY_REPO_USER }} -p ${{ secrets.PIPY_REPO_PASS }} dist/*