-
Notifications
You must be signed in to change notification settings - Fork 2
34 lines (33 loc) · 937 Bytes
/
deploy-python.yml
File metadata and controls
34 lines (33 loc) · 937 Bytes
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
name: Reusable workflow to release in PyPI
# Workflow to deploy a Python package to PyPI
# Triggered manually or by other workflows
on:
workflow_dispatch:
inputs:
package:
type: string
required: true
version:
type: string
required: true
jobs:
deploy-python:
runs-on: ubuntu-latest
steps:
# Set up Python environment
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
# Install dependencies
- name: Install dependencies
run: pip install setuptools wheel twine
# Build the Python package
- name: Build package
run: python setup.py sdist bdist_wheel
# Publish the package to PyPI
- name: Publish package
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: twine upload dist/*