@@ -11,24 +11,7 @@ concurrency:
1111 cancel-in-progress : true
1212
1313jobs :
14- metadata :
15- runs-on : ubuntu-latest
16- outputs :
17- release_version : ${{ steps.compute.outputs.release_version }}
18- steps :
19- - uses : actions/checkout@v6
20-
21- - name : Compute release version
22- id : compute
23- shell : bash
24- run : |
25- set -euo pipefail
26- base_version="$(grep -m1 '^version' codex-rs/Cargo.toml | sed -E 's/version *= *"([^"]+)".*/\1/')"
27- short_sha="${GITHUB_SHA::7}"
28- echo "release_version=${base_version}-${short_sha}" >> "$GITHUB_OUTPUT"
29-
3014 build-unix :
31- needs : metadata
3215 name : Build - ${{ matrix.runner }} - ${{ matrix.target }}
3316 runs-on : ${{ matrix.runner }}
3417 timeout-minutes : 120
7457 echo "${cargo_home}/bin" >> "$GITHUB_PATH"
7558 : > "${cargo_home}/config.toml"
7659
60+ - name : Cache Cargo home and target dir
61+ if : ${{ matrix.target == 'x86_64-unknown-linux-musl' }}
62+ uses : actions/cache@v4
63+ with :
64+ path : |
65+ ${{ github.workspace }}/.cargo-home/registry
66+ ${{ github.workspace }}/.cargo-home/git
67+ codex-rs/target
68+ key : ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('codex-rs/Cargo.lock') }}
69+ restore-keys : |
70+ ${{ runner.os }}-${{ matrix.target }}-cargo-
71+
72+ - name : Cache Cargo home and target dir
73+ if : ${{ matrix.target != 'x86_64-unknown-linux-musl' }}
74+ uses : actions/cache@v4
75+ with :
76+ path : |
77+ ~/.cargo/registry
78+ ~/.cargo/git
79+ codex-rs/target
80+ key : ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('codex-rs/Cargo.lock') }}
81+ restore-keys : |
82+ ${{ runner.os }}-${{ matrix.target }}-cargo-
83+
7784 - name : Install Zig
7885 if : ${{ matrix.target == 'x86_64-unknown-linux-musl' }}
7986 uses : mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29
@@ -148,7 +155,7 @@ jobs:
148155
149156 - name : Cargo build
150157 shell : bash
151- run : cargo build --target ${{ matrix.target }} --release --bin codex
158+ run : cargo build --locked -- target ${{ matrix.target }} --release -p codex-cli --bin codex
152159
153160 - uses : actions/upload-artifact@v7
154161 with :
@@ -157,7 +164,6 @@ jobs:
157164 if-no-files-found : error
158165
159166 build-windows :
160- needs : metadata
161167 name : Build - windows-2025 - ${{ matrix.target }}
162168 runs-on : windows-2025
163169 timeout-minutes : 90
@@ -179,10 +185,23 @@ jobs:
179185 with :
180186 targets : ${{ matrix.target }}
181187
188+ - name : Cache Cargo home and target dir
189+ uses : actions/cache@v4
190+ with :
191+ path : |
192+ ~/.cargo/registry
193+ ~/.cargo/git
194+ codex-rs/target
195+ key : ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('codex-rs/Cargo.lock') }}
196+ restore-keys : |
197+ ${{ runner.os }}-${{ matrix.target }}-cargo-
198+
182199 - name : Cargo build
183200 shell : bash
184201 run : |
185- cargo build --target ${{ matrix.target }} --release \
202+ cargo build --locked --target ${{ matrix.target }} --release \
203+ -p codex-cli \
204+ -p codex-windows-sandbox \
186205 --bin codex \
187206 --bin codex-windows-sandbox-setup \
188207 --bin codex-command-runner
@@ -198,7 +217,6 @@ jobs:
198217
199218 publish-npm :
200219 needs :
201- - metadata
202220 - build-unix
203221 - build-windows
204222 runs-on : ubuntu-latest
@@ -209,6 +227,15 @@ jobs:
209227 steps :
210228 - uses : actions/checkout@v6
211229
230+ - name : Compute release version
231+ id : compute
232+ shell : bash
233+ run : |
234+ set -euo pipefail
235+ base_version="$(grep -m1 '^version' codex-rs/Cargo.toml | sed -E 's/version *= *"([^"]+)".*/\1/')"
236+ short_sha="${GITHUB_SHA::7}"
237+ echo "release_version=${base_version}-${short_sha}" >> "$GITHUB_OUTPUT"
238+
212239 - name : Setup Node.js
213240 uses : actions/setup-node@v6
214241 with :
@@ -258,7 +285,7 @@ jobs:
258285
259286 - name : Stage npm tarballs
260287 env :
261- VERSION : ${{ needs.metadata .outputs.release_version }}
288+ VERSION : ${{ steps.compute .outputs.release_version }}
262289 shell : bash
263290 run : |
264291 set -euo pipefail
@@ -297,7 +324,7 @@ jobs:
297324
298325 - name : Publish to npm
299326 env :
300- VERSION : ${{ needs.metadata .outputs.release_version }}
327+ VERSION : ${{ steps.compute .outputs.release_version }}
301328 shell : bash
302329 run : |
303330 set -euo pipefail
0 commit comments