main is the only long-lived branch. Changes reach it through pull requests, merge commits only, and
every pull request and push to main must pass the build check (.github/workflows/build.yml: validate
composer.json, lint every PHP file and run the offline tests on PHP 8.1, 8.2, 8.3, 8.4 and 8.5). The
integration jobs in the same workflow call the API with the CONVERT_API_SECRET secret; they are shown
on the pull request but not required, so an API outage cannot block a merge. Merging publishes nothing.
There is no package to build or upload: Packagist
publishes every v* tag it sees, through the repository's GitHub webhook. So a tag is the release, and
v* tags are created only by publishing a GitHub Release (repository admins only, by ruleset), which
tomasr78 does:
- In a pull request, set
ConvertApi::VERSIONinlib/ConvertApi/ConvertApi.phpto the new version (it goes into theUser-Agentof every request) and add the version toCHANGELOG.md. Merge it. - Wait for the
buildcheck of that merge onmainto pass, then publish the release:
gh release create v3.0.1 --repo ConvertAPI/convertapi-library-php --target main --title v3.0.1 --generate-notesThat runs .github/workflows/release.yml in the packagist environment, which:
- refuses a Release published or re-run by anyone else;
- checks the tag is SemVer (
v3.0.1,v3.1.0-beta.1), that the GitHub pre-release tick matches the version, that the tagged commit is onmain, and thatConvertApi::VERSIONat the tag is the version; - runs every test, the API ones included, on PHP 8.5 against
CONVERT_API_BASE(a repository variable; the production API when unset) withCONVERT_API_SECRET; - waits up to 15 minutes for https://repo.packagist.org/p2/convertapi/convertapi-php.json to serve the version from the tagged commit.
Packagist serves the version as soon as it sees the tag, so these checks cannot stop a release; a red run
means the version that is already public needs a fix. Pre-releases (--prerelease, e.g.
v3.1.0-beta.1) work the same way and are also tagged on main; Composer installs them only for
minimum-stability below stable or an explicit constraint.
Packagist versions are effectively permanent: users' composer.lock files pin the tag's commit. Never
delete, move or re-create a release tag. Fix a bad version by releasing the next one and say so in both
Releases' notes.
If Packagist stops picking up tags (release.yml times out), check the webhook under the repository's
Settings → Webhooks (https://packagist.org/api/github?username=…) and press Update on
https://packagist.org/packages/convertapi/convertapi-php (Packagist maintainers only).