Conditions
This commit is contained in:
parent
9c5e72f15b
commit
97164df64d
|
@ -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/*
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user