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: PUBLISH:
required: false required: false
default: false default: false
type: boolean
secrets: secrets:
PIPY_REPO_USER: PIPY_REPO_USER:
required: true required: true
type: string
PIPY_REPO_PASS: PIPY_REPO_PASS:
required: true required: true
type: string
jobs: jobs:
test-and-publish: test-and-publish:
@ -23,17 +26,21 @@ jobs:
apt-get update apt-get update
apt-get install -y python3 python3-pip apt-get install -y python3 python3-pip
- name: Installing Python Dependencies - name: Installing Python Dependencies
if: success()
run: python3 -m pip install --upgrade pip setuptools wheel build twine pytest --break-system-packages run: python3 -m pip install --upgrade pip setuptools wheel build twine pytest --break-system-packages
- name: Check out repository code - name: Check out repository code
if: success()
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Installing package - name: Installing package
if: success()
run: python3 -m pip install . --break-system-packages run: python3 -m pip install . --break-system-packages
- name: Test Python Code - name: Test Python Code
if: success()
run: python3 -m pytest test run: python3 -m pytest test
- name: Build - name: Build
if: always() && inputs.PUBLISH if: success() && inputs.PUBLISH
run: python3 -m build run: python3 -m build
- name: Publish - 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/* 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/*