Skip to content

fix: release workflow and immutable release tags for Packagist#55

Merged
yCodeTech merged 7 commits into
masterfrom
fix/release-workflow
Jul 5, 2026
Merged

fix: release workflow and immutable release tags for Packagist#55
yCodeTech merged 7 commits into
masterfrom
fix/release-workflow

Conversation

@yCodeTech

@yCodeTech yCodeTech commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Fixes #54 where Packagist complains the release tag has been modified after the release. To fix we need to completely change how we do releases and auto version bump. We now manually trigger the workflow, input the version tag, run the auto version bump and changelog update jobs, and then create the release and tag pragmatically after committing.

  • Refactor release pipeline to completely change how we do releases and auto version bump. Allowing the workflow to be triggered manually (instead of on-release) with inputs to set the release tag version and publish the release.

    • Introduced release_tag, target_branch with default as master, and prerelease boolean inputs.

    • Introduced publish_only and release_sha inputs to enable the skipping of a version and changelog updates and jump directly to publishing the release.

    • Fixed the release tag behaviour and removed the updating of tag commits.

    • Added a proper publish release job with the creation of immutable tags and releases.

    • Publish releases from resolved release commit SHA to keep tag/release contents aligned both on GitHub and Packagist.

  • Updated versioning validation and enforce semver release tags prefixed with a v.

  • Require both version.php and CHANGELOG.md updates for every release and validate them before creating a PR.

yCodeTech added 2 commits July 4, 2026 18:25
Fixes #54 where packagist complains the release tag has been modified after the release. To fix we need to completely change how we do releases and auto version bump. We now manually trigger the workflow, input the version tag, run the auto version bump and changelog update jobs, and then create the release and tag pragmatically after committing.

- Refactor release pipeline to completely change how we do releases and auto version bump. Allowing the workflow to be triggered manually (instead of on-release) with inputs to set the release tag version and publish the release.

    - Introduced `tag_name`, `target_branch` with default as master, and `prerelease` boolean inputs.

    - Introduced `publish_only` and `release_sha` inputs to enable the skipping of a version and changelog updates and jump directly to publishing the release.

    - Fixed the release tag behaviour and removed the updating of tag commits.

    - Added a proper publish release job with the creation of immutable tags and releases.

    - Publish releases from resolved release commit SHA to keep tag/release contents aligned both on GitHub and Packagist.

- Updated versioning validation and enforce semver release tags prefixed with a v.

- Require both version.php and CHANGELOG.md updates for every release and validate them before creating a PR.
Copilot AI review requested due to automatic review settings July 5, 2026 03:24

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

This PR refactors the release automation to avoid mutating already-published tags (addressing Packagist complaints about modified release tags) by moving to a manually triggered workflow that prepares a release commit/PR and then publishes an immutable tag and GitHub release from the resolved commit SHA.

Changes:

  • Replaced the on: release trigger with a workflow_dispatch release flow that accepts tag/branch/prerelease inputs and supports a publish_only mode.
  • Added workflow logic to bump cli/version.php, update CHANGELOG.md, open/auto-merge a release PR, and publish an immutable tag + GitHub release from the resolved release commit SHA.
  • Updated .editorconfig to enforce spaces for YAML indentation.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
.github/workflows/release.yml Refactors the release pipeline to prepare a release commit and publish immutable tags/releases aligned to a resolved commit SHA.
.editorconfig Ensures YAML files use space indentation (supporting consistent workflow formatting).

Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml
yCodeTech added 2 commits July 5, 2026 04:40
When using publish only mode, the release tag validation is skipped because it's a step in the skippable prepare-release job. But we still need the validation for publish only mode. Fixed by:

- Moved the release tag validation into a separate required job (validate-release-tag) that always runs no matter the mode.

- Refactored code to use the new validate-release-tag job outputs, and require it in the publish-release job.

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 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/release.yml
yCodeTech added 2 commits July 5, 2026 06:42
- Added checks to ensure that existing tags are immutable and point to the expected release commit.
- Implemented conditional steps to handle tag validation based on the `publish_only` input.
…ting

- Changed all instances of the input `tag_name` to `release_tag`.
- Changed the env variable name `TAG_NAME` to `RELEASE_TAG`.
@yCodeTech
yCodeTech merged commit 8247ff3 into master Jul 5, 2026
@yCodeTech
yCodeTech deleted the fix/release-workflow branch July 5, 2026 05:54
@github-actions github-actions Bot mentioned this pull request Jul 5, 2026
yCodeTech pushed a commit that referenced this pull request Jul 5, 2026
docs: update changelog for PR #55

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: auto version bump release workflow doesn't work well with packagist

2 participants