Publish¶
lcp.publish ¶
Publish LCP manifests to the registry via GitHub Pull Request.
PublishError ¶
PublishResult
dataclass
¶
publish_manifest ¶
publish_manifest(document: LCPDocument, token: str, registry_repo: str = _DEFAULT_REGISTRY_REPO) -> PublishResult
Publish an LCP manifest to the registry via GitHub Pull Request.
This function performs the full publish workflow:
- Authenticates with GitHub using the provided token
- Forks the registry repository (if not already forked)
- Creates a branch for the new manifest
- Uploads the manifest file to the correct registry path
- Opens a pull request with structured content and labels
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
document
|
LCPDocument
|
Validated LCP document to publish. |
required |
token
|
str
|
GitHub personal access token with |
required |
registry_repo
|
str
|
Registry repository in |
_DEFAULT_REGISTRY_REPO
|
Returns:
| Type | Description |
|---|---|
PublishResult
|
|
Raises:
| Type | Description |
|---|---|
PublishError
|
If any step of the publish workflow fails. |
ValueError
|
If the registry repo format is invalid. |
Source code in src/lcp/publish.py
401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 | |