-
Notifications
You must be signed in to change notification settings - Fork 1
39 lines (36 loc) · 1.06 KB
/
_publish.yml
File metadata and controls
39 lines (36 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: (abstract) - Publish
on:
workflow_call:
inputs:
dry_run:
required: false
type: boolean
package_to_publish:
required: true
type: string
secrets:
PYPI_API_KEY:
required: true
jobs:
publish-python-packages:
name: Publish ${{ inputs.package_to_publish }} to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- uses: ./.github/workflows/composite/setup-python
- name: "Install Dependencies for Packaging"
run: |
pip3 install twine
pip3 install wheel
pip3 install --requirement ${{ inputs.package_to_publish }}/requirements.txt
- name: "Build Package"
run: |
cd ${{ inputs.package_to_publish }}
python3 setup.py sdist bdist_wheel
- name: "Publish Package"
if: ${{ !inputs.dry_run }}
run: |
cd ${{ inputs.package_to_publish }}
twine upload dist/* -u __token__ -p ${{ secrets.PYPI_API_KEY }}