Skip to content

Trunk-based releases from GitHub Releases; 3.0.1 - #69

Merged
tomasr78 merged 1 commit into
mainfrom
ci/trunk-based-release
Oct 20, 2026
Merged

tomasr78 merged 1 commit into
mainfrom
ci/trunk-based-release

Conversation

@tomasr78

Copy link
Copy Markdown
Contributor

Moves the PHP client to the same trunk-based release flow as convertapi-library-dotnet, and prepares 3.0.1.

Pipeline

  • build.yml (replaces main.yml), on PRs and pushes to main. Runs on PHP 8.1, 8.2, 8.3, 8.4 and 8.5: composer validate --strict, install, php -l on every file, then the offline tests. The single required check is build, which passes only when every PHP version passed. It also checks that ConvertApi::VERSION is SemVer and never lower than the latest release. Composer comes from shivammathur/setup-php tools; the old curl http://getcomposer.org/installer is gone. Every action is pinned to a SHA, with persist-credentials: false.

  • The integration jobs (PHP 8.1 and 8.5) run the API tests with the CONVERT_API_SECRET secret against CONVERT_API_BASE, which is currently staging, https://stag-v2.convertapi.com/. They are not required, so an API outage cannot block a merge. They are skipped when the secret is unavailable (forks, Dependabot).

  • release.yml runs on release: published, in the new packagist environment (v* tags only). It checks:

    • the publisher and the re-run actor are tomasr78;
    • the tag is SemVer, the pre-release tick matches it, and the tag is on main;
    • ConvertApi::VERSION equals the tag.

    It then runs every test on PHP 8.5 and polls repo.packagist.org/p2 for up to 15 minutes, until Packagist serves the tag from the tagged commit.

  • Packagist still publishes through its GitHub webhook, so there is no upload step and no registry key.

  • RELEASING.md, CHANGELOG.md and Dependabot (actions + composer, weekly) are added.

Library (3.0.1)

  • Removes the four curl_close() calls. They have done nothing since PHP 8.0 and are deprecated in PHP 8.5, where every request emitted a deprecation notice; the API tests caught this on 8.5. phpunit.xml.dist now fails on deprecations, notices and warnings from lib/.
  • ConvertApi::VERSION is now 3.0.1, and the repository URLs point to convertapi-library-php. The default branch is now main (renamed from master).

Verified locally on PHP 8.1 and 8.5: 19 tests, 26 assertions against staging.

🤖 Generated with Claude Code

- build.yml replaces main.yml: PR + main builds on PHP 8.1-8.5 (composer
  validate, lint, offline tests) behind one required `build` check; API
  tests run in a non-required `integration` job. Composer comes from
  setup-php (no more http:// installer), actions pinned to SHAs.
- release.yml on release: published checks the publisher, SemVer tag on
  main, ConvertApi::VERSION == tag, runs every test and waits for Packagist
  to serve the tag from the tagged commit.
- Remove curl_close() calls (no-op since PHP 8.0, deprecated in 8.5);
  PHPUnit now fails on deprecations, notices and warnings from lib/.
- ConvertApi::VERSION 3.0.1, CHANGELOG, RELEASING, Dependabot, repo URLs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 20, 2026 07:46
@tomasr78
tomasr78 merged commit eb7bc07 into main Oct 20, 2026
9 checks passed
@tomasr78
tomasr78 deleted the ci/trunk-based-release branch October 20, 2026 07:52

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.

🟡 Changes recommended

Version validation permits invalid or downgraded prereleases, and transient failures terminate Packagist polling instead of retrying.

3 open issues
What changed in this PR

Moves the PHP client to trunk-based releases through GitHub Releases and prepares version 3.0.1.

Changes:

  • Adds multi-version CI, release verification, and dependency updates.
  • Separates offline and integration tests and strengthens runtime warning checks.
  • Removes deprecated cURL calls and documents the release process.
File Description
tests/​ConvertApi/​ConvertApiTest.php Groups API tests and supports configurable endpoints.
tests/​ConvertApi/​ConfigurationTest.php Adds separate offline configuration tests.
RELEASING.md Documents release procedures and recovery.
README.md Updates repository links and build badge.
phpunit.xml.dist Fails on deprecations, notices, and warnings.
lib/​ConvertApi/​ConvertApi.php Bumps version to 3.0.1.
lib/​ConvertApi/​Client.php Removes deprecated curl_close() calls.
docker-compose.yml Adds a PHP 8.4 service.
composer.json Updates repository URLs.
CHANGELOG.md Records 3.0.1 changes.
.github/​workflows/​release.yml Verifies releases and Packagist availability.
.github/​workflows/​main.yml Removes the previous build workflow.
.github/​workflows/​build.yml Adds PHP matrix testing and version checks.
.github/​dependabot.yml Schedules weekly dependency updates.

Review effort: Balanced

run: |
set -euo pipefail
VERSION=$(sed -n "s/^ *const VERSION = '\(.*\)';.*/\1/p" lib/ConvertApi/ConvertApi.php)
SEMVER='^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$'
exit 1
fi
LATEST=$(git tag --list 'v*' | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sed 's/^v//' | sort -V | tail -n1)
if [ -n "$LATEST" ] && [ "$(printf '%s\n%s\n' "$LATEST" "${VERSION%%-*}" | sort -V | tail -n1)" != "${VERSION%%-*}" ]; then
Comment on lines +144 to +145
REF=$(curl -fsS -H 'Cache-Control: no-cache' "https://repo.packagist.org/p2/$PACKAGE.json" \
| jq -r --arg p "$PACKAGE" --arg v "$TAG" '.packages[$p][] | select(.version == $v) | .source.reference // empty')
tomasr78 added a commit that referenced this pull request Oct 20, 2026
Addresses the Copilot review of #69: the Packagist poll in release.yml
aborted on the first failed request under bash -e; SemVer validators
accepted leading-zero pre-release identifiers; build.yml let VERSION be a
pre-release of the latest release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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