PHP (Packagist)

The PHP target publishes to Packagist, the Composer registry. The package name is the target's composerPackageName (for example acme/api). See the PHP configuration for options.

Packagist serves packages straight from a Git tag, so there is no upload step and no secret to add. You connect the repository to Packagist once, and from then on the vX.Y.Z tag and GitHub Release that Scalar creates on merge are the published version.

Enable publishing

{
  "targets": {
    "php": {
      "composerPackageName": "acme/api",
      "publish": { "packagist": true }
    }
  }
}

Connect the repository to Packagist

Submit the repository

On packagist.org, submit your linked repository's URL. Packagist reads composer.json and registers the package.

Enable auto-updates

Connect Packagist's GitHub integration (or add its webhook) so new tags are picked up automatically. Without it, Packagist still updates on its own schedule, just less promptly.

How consumers install it

composer require acme/api

Notes

  • No release workflow is generated for PHP. The sdk-ci.yml workflow still validates and tests the package on every pull request.