{"id":28335047,"url":"https://github.com/mridang/semantic-release-packagist","last_synced_at":"2026-05-09T14:04:42.658Z","repository":{"id":295458379,"uuid":"990098521","full_name":"mridang/semantic-release-packagist","owner":"mridang","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-06T11:05:05.000Z","size":1663,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-06T11:05:11.883Z","etag":null,"topics":["composer","packagist","php","release-automation","semantic-release","semantic-release-plugin"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@mridang/semantic-release-packagist","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mridang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-25T13:57:19.000Z","updated_at":"2025-06-06T11:03:49.000Z","dependencies_parsed_at":"2025-05-25T17:40:39.562Z","dependency_job_id":"99fe5290-8964-4dee-8e60-61a1182fea4b","html_url":"https://github.com/mridang/semantic-release-packagist","commit_stats":null,"previous_names":["mridang/semantic-release-packagist"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/mridang/semantic-release-packagist","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mridang%2Fsemantic-release-packagist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mridang%2Fsemantic-release-packagist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mridang%2Fsemantic-release-packagist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mridang%2Fsemantic-release-packagist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mridang","download_url":"https://codeload.github.com/mridang/semantic-release-packagist/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mridang%2Fsemantic-release-packagist/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260474265,"owners_count":23014688,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["composer","packagist","php","release-automation","semantic-release","semantic-release-plugin"],"created_at":"2025-05-26T21:55:05.593Z","updated_at":"2026-05-09T14:04:42.650Z","avatar_url":"https://github.com/mridang.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Semantic Release - Packagist\n\nA [semantic-release](https://github.com/semantic-release/semantic-release)\nplugin to automatically trigger a package update on [Packagist](https://packagist.org/).\n\nThis plugin automates the final step of a PHP package release workflow. It updates the `version` in your `composer.json` file, and after `semantic-release` publishes a new Git tag, it notifies Packagist to sync the new version from your repository. This eliminates the need for manual updates or webhooks, ensuring your Packagist package is always up-to-date with your latest release.\n\n### Why?\n\nAutomating the release of a PHP package involves more than just creating a Git tag. For a new version to be accessible to the PHP community via Composer, it must be updated on Packagist. This final synchronization step is a common point of friction in an otherwise automated pipeline.\n\nWithout this plugin, developers typically face one of two issues:\n\n- **Dependency on a GitHub App:** The most common method for automation is installing the official Packagist GitHub App. However, this requires administrative permissions on the repository or organization. Some security policies or development workflows may not permit installing external applications, or you may simply prefer a more lightweight integration.\n- **Incomplete Automation:** Other existing `semantic-release` plugins for Composer may correctly update the `version` in your `composer.json` file, but they often stop there. They do not handle the final, crucial step of notifying Packagist that a new version is ready. This leaves a manual gap in the release process, forcing you to log in to Packagist and click \"Update\" or configure separate webhooks.\n- **Missing Metadata Validation:** Many tools may update your `composer.json` but might skip the essential step of validating its contents (e.g., via `composer validate`). This can lead to attempting to publish a new version that Packagist later rejects due to metadata errors, interrupting the release flow and requiring manual intervention.\n\nThis plugin provides a lightweight and direct solution by using the Packagist API. Instead of relying on a GitHub App, it authenticates with a simple `username` and `apiToken` that you provide. It bridges the gap in the release process by ensuring that after `semantic-release` successfully creates a new release, your Packagist package is immediately synchronized. This creates a seamless, end-to-end automated pipeline directly within your `semantic-release` configuration, without requiring extra permissions or external app installations.\n\n## Installation\n\nInstall using NPM by using the following command:\n\n```sh\nnpm install --save-dev @mridang/semantic-release-packagist\n```\n\n## Usage\n\nTo use this plugin, add it to your semantic-release configuration file (e.g., `.releaserc.js`, `release.config.js`, or in your `package.json`).\n\nThe plugin's `prepare` step modifies your `composer.json` and the `composer.lock` file.\nFor this change to be included in the release commit, the plugin should be\nplaced **before** `@semantic-release/git` and `@semantic-release/github` in\nthe `plugins` array.\n\n\u003e [!IMPORTANT]\n\u003e This plugin updates the `version` field in your `composer.json` file during the\n\u003e `prepare` step. For this change to be included in your release commit,\n\u003e you **must** configure the `@semantic-release/git` plugin to add\n\u003e `composer.json` and the `composer.locj` to its `assets` array.\n\n**Example Configuration (`.releaserc.js`):**\n\n```javascript\nmodule.exports = {\n  branches: ['main', 'next'],\n  plugins: [\n    '@semantic-release/commit-analyzer', // Must come first to determine release type\n    // The prepare step of the packagist plugin runs here to update composer.json\n    [\n      '@mridang/semantic-release-packagist',\n      {\n        username: process.env.PACKAGIST_USERNAME,\n        apiToken: process.env.PACKAGIST_TOKEN, // Use an environment variable for security\n      },\n    ],\n    '@semantic-release/release-notes-generator',\n    '@semantic-release/changelog',\n    '@semantic-release/github', // For creating GitHub releases and comments\n    [\n      '@semantic-release/git', // To commit package.json, CHANGELOG.md, etc.\n      {\n        assets: ['composer.json', 'CHANGELOG.md'],\n        message:\n          'chore(release): ${nextRelease.version} [skip ci]\\n\\n${nextRelease.notes}',\n      },\n    ],\n  ],\n};\n```\n\n## Known Issues\n\n- None.\n\n## Useful links\n\n- **[Semantic Release](https://github.com/semantic-release/semantic-release):**\n  The core automated version management and package publishing tool.\n\n## Contributing\n\nIf you have suggestions for how this app could be improved, or\nwant to report a bug, open an issue - we'd love all and any\ncontributions.\n\n## License\n\nApache License 2.0 © 2024 Mridang Agarwalla\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmridang%2Fsemantic-release-packagist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmridang%2Fsemantic-release-packagist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmridang%2Fsemantic-release-packagist/lists"}