@@ -115,13 +115,42 @@ jobs:
115
115
- name : Compress artifacts
116
116
shell : bash
117
117
run : |
118
+ # Path that contains the uncompressed binaries for the current
119
+ # ${{ matrix.target }}
118
120
dest="dist/${{ matrix.target }}"
119
- zstd -T0 -19 --rm "$dest"/*
121
+
122
+ # For compatibility with environments that lack the `zstd` tool we
123
+ # additionally create a `.tar.gz` alongside every single binary that
124
+ # we publish. The end result is:
125
+ # codex-<target>.zst (existing)
126
+ # codex-<target>.tar.gz (new)
127
+ # ...same naming for codex-exec-* and codex-linux-sandbox-*
128
+
129
+ # 1. Produce a .tar.gz for every file in the directory *before* we
130
+ # run `zstd --rm`, because that flag deletes the original files.
131
+ for f in "$dest"/*; do
132
+ base="$(basename "$f")"
133
+ # Skip files that are already archives (shouldn't happen, but be
134
+ # safe).
135
+ if [[ "$base" == *.tar.gz ]]; then
136
+ continue
137
+ fi
138
+
139
+ # Create per-binary tar.gz
140
+ tar -C "$dest" -czf "$dest/${base}.tar.gz" "$base"
141
+
142
+ # Also create .zst (existing behaviour) *and* remove the original
143
+ # uncompressed binary to keep the directory small.
144
+ zstd -T0 -19 --rm "$dest/$base"
145
+ done
120
146
121
147
- uses : actions/upload-artifact@v4
122
148
with :
123
149
name : ${{ matrix.target }}
124
- path : codex-rs/dist/${{ matrix.target }}/*
150
+ # Upload the per-binary .zst files as well as the new .tar.gz
151
+ # equivalents we generated in the previous step.
152
+ path : |
153
+ codex-rs/dist/${{ matrix.target }}/*
125
154
126
155
release :
127
156
needs : build
0 commit comments