6
0

Conditions

This commit is contained in:
Jon Michael Aanes 2024-03-31 22:06:22 +02:00
parent 9c5e72f15b
commit 97164df64d
Signed by: Jmaa
SSH Key Fingerprint: SHA256:Ab0GfHGCblESJx7JRE4fj4bFy/KRpeLhi41y4pF3sNA

View File

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