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/*