Demo for automating the publication of packages in subdirectories of a single GitHub repository.
- PHP 7.0+
- Clone this repo
git clone [email protected]:packagist/composer-split.git
- Edit
.env
cp .env.dist .env
Then edit .env
with your Private Packagist API credentials and GitHub parameters.
The GitHub repo configured in .env
needs to have a composer.json in each subdirecotry in order to publish that as a package in Private Packagist.
Host this repo somewhere and add web/composer-split.php
in a GitHub webhook. This will update your packages in Private Packagist each time you push a change to GitHub.
In case the webhook time out if you have multiple versions or subdirectories, you can run bin/composer-split.php
as part of your CI/CD build or with GitHub actions.
private-packagist/composer-split
is licensed under the MIT License