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].
VERSION should be the version number that the package should be published under, such as v3.0.1 or 3.0.1-alpha.0 (leading v is optional and ignored)
Specify -dry if you want to do a "dry run" which doesn't actually publish to PyPI or create a release
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 the version number contains a prerelease id (such as alpha in this case), then the build gets handled automatically by PyPI as a prerelease. To install it you'd have to specify the specific version (pip install fastly==1.0.1a0).
Click through this link into the "Publish to PyPI" job, and read the output of the "Create Release (Dry Run)" step. You'll see the following output:
## Python API client v1.0.1-alpha.0 (dry run)
Artifact
fastly-1.0.1a0.tar.gz (589KB)
Generated on: Mon Dec 12 11:29:11 UTC 2022
G-code: 8b4af0da, D-code: 237fa474
Pre-release Tag: alpha
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.
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]
.VERSION
should be the version number that the package should be published under, such asv3.0.1
or3.0.1-alpha.0
(leadingv
is optional and ignored)-dry
if you want to do a "dry run" which doesn't actually publish to PyPI or create a releaseThis 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 usingrelease/v1.0.1-alpha.0
has generated the following:alpha
in this case), then the build gets handled automatically by PyPI as a prerelease. To install it you'd have to specify the specific version (pip install fastly==1.0.1a0
).If running in
-dry
mode, no actual PyPI publish or release will be made. Example run usingrelease/v1.0.1-alpha.0-dry
:CI run: https://github.com/fastly/fastly-py/actions/runs/3675322945
Click through this link into the "Publish to PyPI" job, and read the output of the "Create Release (Dry Run)" step. You'll see the following output:
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 namePYPI_PUBLISH_TOKEN
.