Repository navigation
Keep the staging directory out of the release zip - #4
Merged
Merged
Conversation
The v0.1.2 zip shipped an empty build/student-activity-masterstudy/ inside it. The workflow created ./build inside the checkout and then ran `rsync -a ./ build/$SLUG/`, so rsync copied ./ while build/ already existed within it — sweeping the staging directory into its own output. Harmless (empty directories, WordPress installs the plugin fine) but wrong, and the sort of thing a plugin reviewer would query. Staging now happens in $RUNNER_TEMP, outside the checkout, which removes the possibility rather than excluding it after the fact. A guard step fails the build if build/, stage/, tests/ or .git/ ever appear in the staged tree, so a future regression breaks the release instead of shipping quietly. Also adds *.zip and /build to .distignore. CI never sees either, because actions/checkout only fetches tracked files and .gitignore already covers them — but a local `wp dist-archive` run would otherwise fold the previous zip into the new one. Verified by simulating both staging strategies against the working tree: the old one reproduces the nested build/ directories, the new one produces only assets/ and includes/. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
What shipped
The v0.1.2 zip contains an empty
build/student-activity-masterstudy/directory.Harmless — empty directories, the plugin installs and works, and the 0.1.2 fix itself is correctly published. But it shouldn't be there.
Cause
rsynccopies./, which by then contains the freshly-createdbuild/. A self-copy.build/wasn't in.distignore, so it went along for the ride.Fix
Stage in
$RUNNER_TEMP, outside the checkout. That removes the possibility rather than excluding it after the fact.Plus a guard step that fails the build if
build/,stage/,tests/or.git/ever appear in the staged tree — so a future regression breaks the release instead of shipping quietly.Also adds
*.zipand/buildto.distignore. Neither affects CI (actions/checkoutfetches only tracked files, and.gitignorealready covers them), but a localwp dist-archivewould otherwise fold the previous zip into the new one.Verified
Simulated both staging strategies against the working tree:
build/student-activity-masterstudy/assetsassets/andincludes/Do you need to re-release 0.1.2?
I'd say no. The published zip installs correctly and carries the course-filter fix. This makes the next release clean. Re-tagging would mean moving a published tag, which is more disruptive than the cosmetic flaw it corrects.