Skip to content

Commit 33581b1

Browse files
NetdocsCopilot
andcommitted
perf(release): compress single-file binaries (~104MB -> ~53MB)
Enable EnableCompressionInSingleFile so the self-contained release binaries download roughly half as large. This shrinks the payload the Netdocs action must write on CI runners, reducing the chance of a local write failure (curl exit 23) on runners with tight disk/temp. Also make the action's download failure diagnostics actionable: on a failed curl fallback or empty-file guard, print the partial file size and full `df -h` for every mount so disk exhaustion is obvious. Verified locally: a compressed, isolated win-x64 exe (only netdocs.exe, no loose theme) builds the full 244-page Web site; the embedded theme extracts correctly from the compressed bundle. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 369082a commit 33581b1

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/packages.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
echo "::group::publish $rid"
4444
dotnet publish src/Netdocs.Cli -c Release -r "$rid" --self-contained \
4545
-p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true \
46+
-p:EnableCompressionInSingleFile=true \
4647
-p:Version="${VERSION:-0.0.0}" -o "dist/$rid"
4748
echo "::endgroup::"
4849
done

action.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,15 @@ runs:
111111
if [ -z "${download_ok}" ]; then
112112
tmp="${dest}.partial"
113113
rm -f "${tmp}"
114-
curl --fail --location --show-error --silent \
114+
if ! curl --fail --location --show-error --silent \
115115
--retry 5 --retry-delay 3 --retry-all-errors \
116116
--connect-timeout 30 \
117-
-o "${tmp}" "${url}"
117+
-o "${tmp}" "${url}"; then
118+
echo "::error::Failed to download ${url}." >&2
119+
echo "Partial file size:"; ls -l "${tmp}" 2>/dev/null || true
120+
echo "Filesystem usage (all mounts):"; df -h || true
121+
exit 1
122+
fi
118123
mv -f "${tmp}" "${dest}"
119124
fi
120125
@@ -123,7 +128,7 @@ runs:
123128
# Guard against a zero-byte / truncated download slipping through.
124129
if [ ! -s "${dest}" ]; then
125130
echo "::error::Downloaded Netdocs binary is missing or empty: ${dest}" >&2
126-
df -h "${dest_dir}" || true
131+
echo "Filesystem usage (all mounts):"; df -h || true
127132
exit 1
128133
fi
129134

0 commit comments

Comments
 (0)