2020-12-14 15:54:54 -06:00
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
name : PyPI
on :
2021-09-12 22:02:49 -05:00
workflow_dispatch : ~
2020-12-14 15:54:54 -06:00
release :
types : [ published]
env :
2023-07-27 20:05:40 -07:00
DEFAULT_PYTHON : 3.8
2020-12-14 15:54:54 -06:00
jobs :
2023-06-01 17:59:00 -06:00
build :
name : Build
2020-12-14 15:54:54 -06:00
runs-on : ubuntu-latest
steps :
- name : Checkout code
2023-09-17 13:58:55 -07:00
uses : actions/checkout@v4
2020-12-14 15:54:54 -06:00
- name : Set up Python
2022-06-11 09:21:27 -05:00
uses : actions/setup-python@v4
2020-12-14 15:54:54 -06:00
with :
python-version : ${{ env.DEFAULT_PYTHON }}
- name : Install dependencies and build
run : |
pip install -U pip
2021-09-12 21:29:56 -05:00
pip install -r requirements.txt
2020-12-14 15:54:54 -06:00
pip install setuptools wheel
python setup.py sdist bdist_wheel
2023-06-01 17:59:00 -06:00
- name : Upload builds
uses : actions/upload-artifact@v3
2020-12-14 15:54:54 -06:00
with :
2023-06-01 17:59:00 -06:00
name : dist
path : dist
pypi :
name : Publish to PyPI
2023-07-27 18:31:31 -07:00
needs : build
2023-06-01 17:59:00 -06:00
runs-on : ubuntu-latest
2023-07-27 18:31:31 -07:00
environment :
name : pypi
url : https://pypi.org/p/PlexAPI
2023-06-01 17:59:00 -06:00
permissions :
id-token : write
steps :
- name : Download builds
uses : actions/download-artifact@v3
- name : Publish to PyPI
uses : pypa/gh-action-pypi-publish@release/v1