Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Release zip archived binaries (#2438)

UnownPlain5b1989f4d781
diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml
index d3e313b3cc..c30ffdf61c 100644
--- a/.github/workflows/rust-release.yml
+++ b/.github/workflows/rust-release.yml
@@ -117,10 +117,11 @@ jobs:
dest="dist/${{ matrix.target }}"
# For compatibility with environments that lack the `zstd` tool we
- # additionally create a `.tar.gz` alongside every single binary that
- # we publish. The end result is:
+ # additionally create a `.tar.gz` for all platforms and `.zip` for
+ # Windows alongside every single binary that we publish. The end result is:
# codex-<target>.zst (existing)
# codex-<target>.tar.gz (new)
+ # codex-<target>.zip (only for Windows)
# 1. Produce a .tar.gz for every file in the directory *before* we
# run `zstd --rm`, because that flag deletes the original files.
@@ -128,13 +129,20 @@ jobs:
base="$(basename "$f")"
# Skip files that are already archives (shouldn't happen, but be
# safe).
- if [[ "$base" == *.tar.gz ]]; then
+ if [[ "$base" == *.tar.gz || "$base" == *.zip ]]; then
continue
fi
# Create per-binary tar.gz
tar -C "$dest" -czf "$dest/${base}.tar.gz" "$base"
+ # Create zip archive for Windows binaries
+ # Must run from inside the dest dir so 7z won't
+ # embed the directory path inside the zip.
+ if [[ "${{ matrix.runner }}" == windows* ]]; then
+ (cd "$dest" && 7z a "${base}.zip" "$base")
+ fi
+
# Also create .zst (existing behaviour) *and* remove the original
# uncompressed binary to keep the directory small.
zstd -T0 -19 --rm "$dest/$base"