Skip to content

ci: publish GitHub releases to Packagist - #2

Open
galetahub wants to merge 2 commits into
masterfrom
ci-release-workflow
Open

ci: publish GitHub releases to Packagist#2
galetahub wants to merge 2 commits into
masterfrom
ci-release-workflow

Conversation

@galetahub

Copy link
Copy Markdown
Contributor

Summary

  • Add a release workflow that runs on published GitHub releases and notifies Packagist after the tag and tests succeed.
  • Fail when the release tag does not match SerpApi\Client::VERSION

Setup

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a GitHub Actions release pipeline that validates the release tag against the library’s SerpApi\Client::VERSION, runs the full PHP test matrix on the released tag, and then triggers a Packagist metadata refresh once checks pass.

Changes:

  • Introduces a release-triggered workflow that runs on GitHub Release published events.
  • Verifies the tag name matches v{SerpApi\\Client::VERSION} before proceeding.
  • Runs tests across the project’s supported PHP versions and triggers a Packagist crawl on success.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +15 to +22
- name: Check out the released revision
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6

- name: Verify release tag matches the package version
shell: bash
run: |
set -euo pipefail
package_version="$(php -r 'require "src/Client.php"; echo (new ReflectionClass(SerpApi\Client::class))->getConstant("VERSION");')"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pinned PHP version 8.5.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

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