Publish PHP SDKs automatically
You can publish SDKs generated in Postman to Packagist. Automated publishing is supported through GitHub tags and Packagist VCS webhooks, which can be configured to sync new tagged releases from your GitHub repository.
You can also publish manually from your local machine. To learn more, see Publish PHP SDKs manually.
Choose one of the following methods to publish your SDKs automatically:
- Publish using Packagist webhook sync (no CI secret required).
- Publish using webhook sync plus optional immediate-sync secrets.
Prerequisites
- A Packagist account.
- The package name in
composer.json(vendor/package) is the name you publish under.
Set up webhook-based publishing
Packagist publishes versions from semantic Git tags discovered through a VCS webhook.
To configure webhook-based publishing, do the following:
- Submit the package at Packagist by entering your GitHub repository URL.
- Set up auto-updates for new tags by choosing one of these options:
- Connect GitHub in Packagist — Profile > Settings > Connect GitHub.
- Add a manual Packagist webhook in GitHub — Settings > Webhooks (use the URL and token from your Packagist profile).
Once the webhook is configured, each new release tag is picked up automatically by Packagist.
Add optional immediate-sync secrets
Optional Packagist credentials can trigger an immediate package sync ping instead of waiting for webhook processing.
To add optional immediate-sync secrets, do the following:
- In Packagist, go to Profile > Show API Token and copy your token.
- In GitHub, select your repository and click Settings > Secrets and variables > Actions > New repository secret.
- Add the following secrets:
PACKAGIST_USERNAME— Your Packagist username.PACKAGIST_API_TOKEN— Your Packagist API token.
- If these secrets aren’t set, publishing still works through webhook-based synchronization.
- Versions come from semantic Git tags, not from a version field in
composer.json.