2020-12-14 21:54:54 +00: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-13 03:02:49 +00:00
workflow_dispatch : ~
2020-12-14 21:54:54 +00:00
release :
types : [ published]
env :
2023-07-28 03:05:40 +00:00
DEFAULT_PYTHON : 3.8
2020-12-14 21:54:54 +00:00
jobs :
2023-06-01 23:59:00 +00:00
build :
name : Build
2020-12-14 21:54:54 +00:00
runs-on : ubuntu-latest
steps :
- name : Checkout code
2023-09-17 20:58:55 +00:00
uses : actions/checkout@v4
2020-12-14 21:54:54 +00:00
- name : Set up Python
2022-06-11 14:21:27 +00:00
uses : actions/setup-python@v4
2020-12-14 21:54:54 +00:00
with :
python-version : ${{ env.DEFAULT_PYTHON }}
- name : Install dependencies and build
run : |
pip install -U pip
2021-09-13 02:29:56 +00:00
pip install -r requirements.txt
2023-11-05 21:22:31 +00:00
pip install setuptools twine wheel
2020-12-14 21:54:54 +00:00
python setup.py sdist bdist_wheel
2023-11-05 21:22:31 +00:00
- name : Verify README
# https://packaging.python.org/guides/making-a-pypi-friendly-readme/#validating-restructuredtext-markup
run : |
python -m twine check dist/*
2023-06-01 23:59:00 +00:00
- name : Upload builds
uses : actions/upload-artifact@v3
2020-12-14 21:54:54 +00:00
with :
2023-06-01 23:59:00 +00:00
name : dist
path : dist
pypi :
name : Publish to PyPI
2023-07-28 01:31:31 +00:00
needs : build
2023-06-01 23:59:00 +00:00
runs-on : ubuntu-latest
2023-07-28 01:31:31 +00:00
environment :
name : pypi
url : https://pypi.org/p/PlexAPI
2023-06-01 23:59:00 +00: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