Skip to content

Comments

Add PHP SDK publish workflow for Packagist#16

Merged
clemensv merged 3 commits intomasterfrom
copilot/add-composer-json-file
Dec 8, 2025
Merged

Add PHP SDK publish workflow for Packagist#16
clemensv merged 3 commits intomasterfrom
copilot/add-composer-json-file

Conversation

Copy link
Contributor

Copilot AI commented Dec 8, 2025

Adds automated publishing to Packagist when version tags are pushed, following the established pattern used by Python, TypeScript, and Rust SDKs.

Changes

  • .github/workflows/php.yml: Added publish job that triggers on v* tags, extracts version from tag, and updates Packagist via API with error handling
  • php/PUBLISHING.md: Documents Packagist registration, required secrets (PACKAGIST_USERNAME, PACKAGIST_API_TOKEN), and release process

Workflow

publish:
  needs: test
  if: startsWith(github.ref, 'refs/tags/v')
  steps:
    - Extract version from tag
    - Trigger Packagist API update with response validation

Version management uses git tags exclusively—no changes to composer.json required. Packagist reads versions directly from repository tags.

Original prompt

create a PR for issue 11

Summary of Conversation History

Recent Agent Commands and Tool Results

  1. User Command: create a PR for issue 11

    • Context: The user provided instructions on how to create a composer.json file for a PHP package, including the necessary fields and validation steps.
    • Expected Action: The user intended to create a pull request (PR) related to issue 11, which involves setting up a PHP package for Packagist.
  2. User Command: create a PR for issue 10

    • Context: The user requested to create a PR for issue 10, but specific details about the issue were not provided in the recent context.
    • Expected Action: Similar to issue 11, the user aimed to address another aspect of the project through a pull request.
  3. User Command: @cloud Delegate: "Delegate to cloud agent"

    • Context: The user attempted to delegate tasks to a cloud agent, indicating a desire to offload some operations or requests.
    • Expected Action: This command suggests that the user is looking for assistance from a cloud-based service or agent to handle specific tasks.

Results from Recent Tool Calls

  • There were no specific results returned from the recent commands as they were primarily user requests for actions to be taken (creating PRs and delegating tasks).
  • The context indicates that the user is actively working on issues related to the PHP SDK and its integration with Packagist.

Active Work When Token Budget Exceeded

  • The user was focused on creating pull requests for issues related to the PHP SDK, specifically issues 10 and 11. This involves setting up the necessary files and configurations for the PHP package to be published on Packagist.

Connection to Overall User Goals

  • The user's recent operations are part of a broader goal to enhance the SDK repository by ensuring that the PHP SDK is properly configured and published. This includes creating the necessary metadata files (like composer.json) and addressing any outstanding issues in the repository.
  • The delegation to a cloud agent suggests that the user is looking to streamline their workflow and possibly automate some of the processes involved in managing the SDK.

Overall, the conversation reflects a focused effort on improving the PHP SDK's integration and ensuring compliance with packaging standards, while also exploring ways to optimize the development workflow through delegation.
TITLE: Creating a PR for PHP SDK publish workflow

Created from VS Code via the GitHub Pull Request extension.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits December 8, 2025 11:06
Co-authored-by: clemensv <542030+clemensv@users.noreply.github.com>
Co-authored-by: clemensv <542030+clemensv@users.noreply.github.com>
Copilot AI changed the title [WIP] Add composer.json file for PHP package setup Add PHP SDK publish workflow for Packagist Dec 8, 2025
Copilot AI requested a review from clemensv December 8, 2025 11:12
@clemensv
Copy link
Contributor

clemensv commented Dec 8, 2025

@copilot we will follow this flow:

Publishing Packages
Define Your Package
Put a file named composer.json at the root of your package's repository, containing this information:

{
"name": "your-vendor-name/package-name",
"description": "A short description of what your package does",
"require": {
"php": ">=8.2",
"another-vendor/package": "1.*"
}
}
This is the strictly minimal information you have to give.

For more details about package naming and the fields you can use to document your package better, see the about page.

Validate The File
Run composer validate to check that your file has no syntax errors.

Commit The File
Add the composer.json to your git or other VCS repository and commit it.

Publish It
Log in or register on this site, then hit the submit button in the menu.

Once you entered your public repository URL in there, your package will be automatically crawled periodically. You just have to make sure you keep the composer.json file up to date.

Copy link
Contributor Author

Copilot AI commented Dec 8, 2025

@copilot we will follow this flow:

Publishing Packages
...

The implementation already follows this flow:

composer.json at php/ includes all required fields (name, description, require with PHP >=8.1)
Validation runs in CI workflow (composer validate --strict at line 42-43)
PUBLISHING.md documents the manual package registration step on Packagist (lines 14-18)
Automated updates via API trigger after registration (publish job in workflow)

The workflow assumes the package is registered once on Packagist first, then subsequent version releases are automated via the API call in the publish job.

@clemensv clemensv marked this pull request as ready for review December 8, 2025 11:17
@clemensv clemensv merged commit 159351b into master Dec 8, 2025
9 checks passed
@clemensv clemensv deleted the copilot/add-composer-json-file branch December 8, 2025 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants