Skip to content

Keep the staging directory out of the release zip - #4

Merged
POBrien333 merged 1 commit into
mainfrom
fix/release-zip-self-copy
Oct 4, 2026
Merged

POBrien333 merged 1 commit into
mainfrom
fix/release-zip-self-copy

Conversation

@POBrien333

Copy link
Copy Markdown
Owner

What shipped

The v0.1.2 zip contains an empty build/student-activity-masterstudy/ directory.

student-activity-masterstudy/
├── assets/
├── build/                          <- should not be here
│   └── student-activity-masterstudy/
└── includes/

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

mkdir -p build/"$SLUG"
rsync -a --exclude-from=.distignore ./ build/"$SLUG"/

rsync copies ./, which by then contains the freshly-created build/. 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 *.zip and /build to .distignore. Neither affects CI (actions/checkout fetches only tracked files, and .gitignore already covers them), but a local wp dist-archive would otherwise fold the previous zip into the new one.

Verified

Simulated both staging strategies against the working tree:

Result
Old — staged inside the checkout reproduces build/student-activity-masterstudy/assets
New — staged outside only assets/ and includes/

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.

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>
@POBrien333
POBrien333 merged commit ab2d53f into main Oct 4, 2026
2 checks passed
@POBrien333
POBrien333 deleted the fix/release-zip-self-copy branch October 4, 2026 11:26
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.

1 participant