Repository navigation
Conversation
The duplicate check only compared the commit SHA (and later a substring of the version) against the tip of the build branch. A release build with an explicit PACKAGE_VERSION on an unchanged commit could therefore reuse the previous dev build and ship its auto-generated version string. - Fingerprint each build from the commit SHA, the resolved package version, all workflow inputs, and the reusable workflow revision; record it as a Build-Key commit trailer. - Search the whole build branch history for a matching fingerprint, so alternating inputs for the same commit don't rebuild each other away. On a hit, package the matching commit and push nothing. - Expose the build commit as a `build-commit` workflow output so downstream jobs can reference the exact build instead of the branch name. - wordpress-org-release: compare the full plugin header version exactly, so a build-stamped version like 1.2.3+main.abc1234 no longer passes as 1.2.3. - Docs: describe the fingerprint and outputs, fix the stale version format.
…er parsing - Fail the fingerprint step if job.workflow_sha is empty, so a fix to this workflow can never silently reuse builds made before it. - wordpress-org-release: parse headers like WordPress' get_file_data() (optional "<?php", "//" comments, case-insensitive, comment closers stripped), and read readme.txt's full Stable tag value instead of the first x.y.z, so e.g. 1.2.3-rc1 no longer passes as 1.2.3. - Docs: the publish example only runs for releases.
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.
Problem
The duplicate-build check in
build-and-distributecompared the commit SHA (and, since 0ca4322, a substring of the version) against the tip of the build branch. Two failure modes followed:PACKAGE_VERSION(e.g.8.2.1) on a commit that already had a dev build could reuse that dev build. The substring match letsVersion: 8.2.1matchVersion: 8.2.1+main.abc1234. Combined with the SVN sync, the public release then carries the auto-generated dev version.Changes
build-and-distribute.ymljob.workflow_sha), the resolvedPACKAGE_VERSION, andtoJSON(inputs). New inputs are covered automatically.ENV_VARSis deliberately excluded because it is a secret and the fingerprint is public.Build-Key:commit trailer on every build commit.--allow-emptymakes sure the key is recorded even when the output is unchanged.build-commitoutput: the SHA of the build commit the artifact came from. Downstream steps (tagging, deploying, SVN release) should use it instead of the build branch name, because a reused build is not necessarily the branch tip.SHA:header.wordpress-org-release.ymlx.y.zwas extracted, so8.2.1+main.abc1234passed as8.2.1. This guard makes a wrong version fail the release regardless of what happens upstream.Docs
GIT_REF: build-commitexample for the SVN release).{release}+{branch}.{short-sha}(build metadata), not{release}-{branch}.Rollout notes
needs.<build-job>.outputs.build-commitasGIT_REFtowordpress-org-releaseinstead of a branch name.job.workflow_shaand causes one rebuild per consumer.job.workflow_sharequires runner v2.334.0+ and is not available on GHES. If it is empty, the only effect is that workflow changes don't invalidate old builds.Testing
Follow-up
A stacked PR restructures the workflow into
resolve/build/packagejobs to remove theSKIP_BUILDconditions and fixes the push race between different commits.