43 lines
1.2 KiB
YAML
43 lines
1.2 KiB
YAML
name: Python Package
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
secrets:
|
|
PIPY_REPO_USER:
|
|
required: true
|
|
PIPY_REPO_PASS:
|
|
required: true
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Setting up python
|
|
run: |
|
|
apt-get update
|
|
apt-get install -y python3 python3-pip
|
|
- name: Installing dependencies
|
|
run: python3 -m pip install --upgrade pip setuptools wheel build twine pytest
|
|
- name: Check out repository code
|
|
uses: actions/checkout@v3
|
|
- name: Test
|
|
run: python3 -m pytest test
|
|
publish:
|
|
runs-on: ubuntu-latest
|
|
needs: [test]
|
|
steps:
|
|
- name: Setting up python
|
|
run: |
|
|
apt-get update
|
|
apt-get install -y python3 python3-pip
|
|
- name: Installing dependencies
|
|
run: python3 -m pip install --upgrade pip setuptools wheel build twine pytest
|
|
- name: Check out repository code
|
|
uses: actions/checkout@v3
|
|
- name: Build
|
|
run: python3 -m build
|
|
- name: Publish
|
|
run: python3 -m twine upload --repository-url "https://gitea.example.com/api/packages/${{ secrets.PIPY_REPO_USER }}/pypi" -u ${{ secrets.PIPY_REPO_USER }} -p ${{ secrets.PIPY_REPO_PASS }} dist/*
|
|
|