fastly / fastly-py

A Fastly API client for Python
https://pypi.org/project/fastly/
MIT License
77 stars 60 forks source link

CI to automatically publish to PyPI #83

Closed harmony7 closed 1 year ago

harmony7 commented 1 year ago

This PR adds a publish mechanism to allow this API client to publish itself to PyPI and create a release in GitHub.

The input is to create a tag in this repo and push it, with the syntax: release/[VERSION][-dry].

This CI is intended to be used along with the client generator project, whose job it is to generate the newest API client code, tag it with said version code, and push it to this repo.

Unless running in -dry mode, this CI step will create a real version in PyPI, and a release in GitHub. Example run using release/v1.0.1-alpha.0 has generated the following:

If running in -dry mode, no actual PyPI publish or release will be made. Example run using release/v1.0.1-alpha.0-dry:

This CI relies on a PyPI access token with publish access to the fastly project. This token is stored as a repository secret under the name PYPI_PUBLISH_TOKEN.