fix(release): repair Packagist publishing pipeline - #35
Merged
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the RELEASE.md documentation to reflect a transition from using Packagist webhooks to a release workflow that utilizes Packagist's /api/update-package endpoint. The changes include updated step-by-step instructions for configuring Packagist API tokens and GitHub secrets, as well as an updated setup checklist. I have no feedback to provide.
Two related repairs to get the release pipeline functional: 1. Fix the dead `workflow_run` trigger in `.github/workflows/release.yml`. The filter was `workflows: ['CI']`, but the CI workflow was renamed to `Quality Checks` (`qa.yml`) in commit f9b09cf. GitHub matches `workflows:` against the `name:` field, not the filename, so the release workflow has been silently dead since that rename — `gh run list --workflow release.yml` returns empty repo-wide and zero tags exist on origin. Updated to `workflows: ['Quality Checks']`. 2. Replace the OAuth/repo-webhook based Packagist sync with an explicit POST from the release workflow after each tag push. This decouples Packagist publishing from any individual contributor's GitHub OAuth grant — the company-owned Packagist account holds the API token (`PACKAGIST_API_TOKEN` repo secret) and the workflow uses it directly. New step is gated on `git describe --tags --exact-match HEAD` so it only runs when semantic-release actually created a tag, and derives the repo URL from `\${GITHUB_REPOSITORY}` so it survives a rename. RELEASE.md updated to reflect the new flow: chain diagram, Automated Flow step 5, Packagist Setup section, and Prerequisites checklist. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
DmytroConvert
approved these changes
Apr 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two related repairs to get the release pipeline functional. Without these,
convertcom/php-sdkhas zero installable versions on Packagist.1. Fix the dead
workflow_runtrigger.github/workflows/release.ymlwas waiting onworkflows: ['CI'], but the CI workflow was renamed toQuality Checks(qa.yml) in commitf9b09cf. GitHub matchesworkflows:against thename:field, not the filename, so the release workflow has been silently dead since that rename:gh run list --workflow release.ymlreturns empty repo-wide.gh api repos/convertcom/php-sdk/tagsreturns[]— zero git tags ever./p2/convertcom/php-sdk.jsonreportsversions: 0.Changed to
workflows: ['Quality Checks'].2. Switch Packagist publish to API POST (off OAuth)
The current Packagist setup expects "connecting your GitHub account" — an OAuth grant tied to an individual GitHub user. For a company-owned package, that ties sync availability to whoever clicked Authorize: if they're removed from the org or revoke the grant, Packagist sync silently breaks. Routing the update through Packagist's API instead keeps the credential on the shared Packagist account (API token in repo secrets), with no individual GitHub identity in the loop.
Changes
.github/workflows/release.ymlworkflows: ['CI']→workflows: ['Quality Checks'](matchesqa.ymlname:field).Notify Packagist of new releaseafterRun semantic-release:git describe --tags --exact-match HEAD— no-op when semantic-release didn't tag.{ repository: { url } }tohttps://packagist.org/api/update-packagewithPACKAGIST_USERNAME+PACKAGIST_API_TOKENfrom repo secrets.${GITHUB_REPOSITORY}so it survives renames/forks.curl -fsSLso a bad response fails the workflow loudly.RELEASE.mdPACKAGIST_USERNAMEandPACKAGIST_API_TOKENas repo secrets. Explicit note that no GitHub OAuth grant ("connect your user account") is needed and why.What happens on merge
Verified by running
yarn release --dry-runagainst this branch:semantic-release's
get-next-version.jshardcodesFIRST_RELEASE = "1.0.0"when no prior tag exists — this is the literal constant, the analyzer's bump type is ignored on first release. So the merge producesv1.0.0(notv1.0.1), with a CHANGELOG covering all 14 historicalfeat:/fix:/refactor:commits since project inception (the 118chore:/docs:/ci:/test:/style:/perf:/merge commits are filtered out by the preset config).Required follow-up before merge
These belong on Packagist + GitHub repo settings, not in this PR:
PACKAGIST_USERNAMEandPACKAGIST_API_TOKEN.Test plan
PACKAGIST_USERNAMEandPACKAGIST_API_TOKENrepo secrets.main.workflow_run(it has never fired before this PR).v1.0.0, generatesCHANGELOG.md, commits with[skip ci], pushes the tag.Notify Packagist of new releasestep reportsNotifying Packagist of release v1.0.0and exits 0.convertcom/php-sdkv1.0.0 appears on Packagist within ~1 min.composer require convertcom/php-sdkresolves to1.0.0from a clean test directory.🤖 Generated with Claude Code