Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/valentiniljaz/packagist-publish
Publish Composer package to Private Packagist using API
https://github.com/valentiniljaz/packagist-publish
Last synced: 24 days ago
JSON representation
Publish Composer package to Private Packagist using API
- Host: GitHub
- URL: https://github.com/valentiniljaz/packagist-publish
- Owner: valentiniljaz
- License: mit
- Created: 2022-04-21T06:30:04.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-20T08:55:36.000Z (4 months ago)
- Last Synced: 2024-11-22T17:59:52.425Z (about 1 month ago)
- Language: PHP
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
## Private Packagist Publish
Publish your package to Packagist.com using API. Very useful for PHP monorepos.
### Install
Add the package as dev dependency to your project:
```
composer require --dev valentiniljaz/packagist-publish
```### Use
Publish your package:
```
./vendor/bin/packagist-publish
```> Initial publish of the package must be done manually by uploading
> archive to Packagist.comIf you only need to prepare archive for publishing:
```
./vendor/bin/packagist-archive
```Help about commands:
```
./vendor/bin/packagist-publish -h
./vendor/bin/packagist-archive -h
```### How it works
#### 1) Builds zip archive using GIT
```
git archive -o HEAD[:]
```> You must have all your changes committed.
#### 2) Publishes archive to Packagist.com using API endpoint
```
POST /api/packages//artifacts/
```> You must provide Packagist API Key and Secret either
> by command params (--apiKey, --apiSecret)
> or by env variables (PACKAGIST_KEY, PACKAGIST_SECRET).
> Params have precedence over env vars.#### Details
- If path to composer.json is not specified by command option it'll take the first composer.json it finds from current working dir upwards.
- For GIT ARCHIVE it needs to know the root of GIT repo; it'll take the first dir containing `.git` from current working dir upwards.
- Default destination for archive is the location of dir containing composer.json.
- If you need to ignore specific folder(s)/file(s) from archive you can use `.gitattributes` and set `export-ignore` attribute.## Author
Valentin Iljaž
[[email protected]](mailto:[email protected])
## License
MIT