6
0

Conditional publish

This commit is contained in:
Jon Michael Aanes 2024-03-30 16:14:58 +01:00
parent 3cdfd3d7c7
commit 9c5e72f15b
Signed by: Jmaa
SSH Key Fingerprint: SHA256:Ab0GfHGCblESJx7JRE4fj4bFy/KRpeLhi41y4pF3sNA

View File

@ -3,6 +3,9 @@ name: Python Package
on:
workflow_call:
inputs:
PUBLISH:
required: false
default: false
secrets:
PIPY_REPO_USER:
required: true
@ -28,7 +31,9 @@ jobs:
- name: Test Python Code
run: python3 -m pytest test
- name: Build
if: always() && inputs.PUBLISH
run: python3 -m build
- name: Publish
if: always() && 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/*