2024-03-19 12:45:34 -04:00
# This workflow will upload a Python Package to PyPI when a release is created
2022-10-10 11:12:22 +00:00
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
2020-02-20 13:59:00 -05:00
2021-06-03 10:55:41 -04:00
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
2019-08-25 01:13:29 +01:00
name : Upload Python Package
2019-09-05 12:10:28 +01:00
on :
release :
2021-06-03 10:55:41 -04:00
types : [ published]
2019-08-25 01:13:29 +01:00
2024-03-19 16:41:37 -04:00
permissions :
contents : read
2019-08-25 01:13:29 +01:00
jobs :
2024-03-19 12:45:34 -04:00
release-build :
runs-on : ubuntu-latest
steps :
- uses : actions/checkout@v4
2020-02-21 12:55:06 -05:00
2024-03-19 12:45:34 -04:00
- uses : actions/setup-python@v5
with :
python-version : "3.x"
2024-03-19 15:40:07 -04:00
- name : Build release distributions
2024-03-19 12:45:34 -04:00
run : |
# NOTE: put your own distribution build steps here.
python -m pip install build
python -m build
2024-03-19 15:40:07 -04:00
- name : Upload distributions
2024-03-19 12:45:34 -04:00
uses : actions/upload-artifact@v4
with :
name : release-dists
path : dist/
pypi-publish :
2019-08-25 01:13:29 +01:00
runs-on : ubuntu-latest
2024-03-19 12:45:34 -04:00
needs :
- release-build
permissions :
id-token : write
2020-02-21 12:55:06 -05:00
2019-08-25 01:13:29 +01:00
steps :
2024-03-19 12:45:34 -04:00
- name : Retrieve release distributions
uses : actions/download-artifact@v4
with :
name : release-dists
path : dist/
- name : Publish release distributions to PyPI
uses : pypa/gh-action-pypi-publish@release/v1