Skip to content

Commit 06f90e3

Browse files
jdclaude
andauthored
fix(release): select wheel binary by target, not both patterns (#1596)
`unzip -joq "${whl}" '*/scripts/mergify' '*/scripts/mergify.exe'` returns exit code 11 ("no matching files") for whichever pattern doesn't apply — every wheel ships exactly one of the two binaries, never both. The 11 propagates under `set -euo pipefail` and kills the script even when the other pattern extracted cleanly. Symptom in production: the 2026.6.15.1 draft attempt (https://github.com/Mergifyio/mergify-cli/actions/runs/27546073002) failed at the Extract step on the Linux x86_64 wheel — the only output before the bail was `caution: filename not matched: */scripts/mergify.exe`. Wheels themselves were fine. Fix: pick the binary name up front from the target string (`mergify.exe` for windows, `mergify` otherwise) and pass `unzip` the single matching pattern. The two-arm if/else below already needed a target check, so the cost is paid once and shared. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent b67c59f commit 06f90e3

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,16 +104,27 @@ jobs:
104104
target="${dir#artifacts/wheel-}"
105105
whl=$(ls "${dir}"/*.whl | head -1)
106106
workdir=$(mktemp -d)
107+
# Pick the binary name up-front from the target — every
108+
# wheel ships exactly one of `mergify` or `mergify.exe`,
109+
# never both. Passing *both* patterns to `unzip` made it
110+
# exit 11 ("no matching files") for whichever pattern
111+
# didn't apply, even when the other one did extract,
112+
# killing the script under `set -e`.
113+
if [[ "${target}" == *windows* ]]; then
114+
bin=mergify.exe
115+
else
116+
bin=mergify
117+
fi
107118
# `-joq` is the combined form of `-j -o -q`: junk paths
108119
# (flatten), overwrite without prompting, quiet. The
109120
# wheel layout is `<dist>.data/scripts/<bin>`; we only
110121
# want `<bin>` extracted at the workdir root.
111-
unzip -joq "${whl}" '*/scripts/mergify' '*/scripts/mergify.exe' -d "${workdir}"
122+
unzip -joq "${whl}" "*/scripts/${bin}" -d "${workdir}"
112123
if [[ "${target}" == *windows* ]]; then
113-
(cd "${workdir}" && zip -q "${OLDPWD}/dist/mergify-${target}.zip" mergify.exe)
124+
(cd "${workdir}" && zip -q "${OLDPWD}/dist/mergify-${target}.zip" "${bin}")
114125
else
115-
chmod +x "${workdir}/mergify"
116-
tar -C "${workdir}" -czf "dist/mergify-${target}.tar.gz" mergify
126+
chmod +x "${workdir}/${bin}"
127+
tar -C "${workdir}" -czf "dist/mergify-${target}.tar.gz" "${bin}"
117128
fi
118129
rm -rf "${workdir}"
119130
done

0 commit comments

Comments
 (0)