This PR adds a publish mechanism to allow this API client to publish itself to Packagist 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-alpha0 (leading v is optional and ignored)
Specify -dry if you want to do a "dry run" which doesn't actually publish to Packagist 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 Packagist, and a release in GitHub. Example run using release/v1.0.1-alpha0 has generated the following:
Click through this link into the "Publish to Packagist" job, and read the output of the "Create Release (Dry Run)" step. You'll see the following output:
## PHP API client v1.0.1-alpha0 (dry run)
Artifact
fastly-1.0.1-alpha0.zip (2.2MB)
Generated on: Mon Dec 12 05:00:32 UTC 2022
G-code: 8b4af0da, D-code: 237fa474
Pre-release Tag: alpha0
This CI relies on Packagist's ability to "auto-update" from tags in the repo. Therefore this CI uses the release/<VERSION> syntax as input, but creates its own tag that looks like v<VERSION>. Packagist is notified of new tags via a Webhook, and creates a version by crawling it.
This PR adds a publish mechanism to allow this API client to publish itself to Packagist 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-alpha0
(leadingv
is optional and ignored)-dry
if you want to do a "dry run" which doesn't actually publish to Packagist 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 Packagist, and a release in GitHub. Example run usingrelease/v1.0.1-alpha0
has generated the following:If running in
-dry
mode, no actual Packagist publish or release will be made. Example run usingrelease/v1.0.1-alpha0-dry
:CI run: https://github.com/fastly/fastly-php/actions/runs/3672807585
Click through this link into the "Publish to Packagist" job, and read the output of the "Create Release (Dry Run)" step. You'll see the following output:
This CI relies on Packagist's ability to "auto-update" from tags in the repo. Therefore this CI uses the
release/<VERSION>
syntax as input, but creates its own tag that looks likev<VERSION>
. Packagist is notified of new tags via a Webhook, and creates a version by crawling it.