Skip to content

Commit e8c6664

Browse files
committed
fix(tui,ci): tidy test-mode ESC and harden release workflow
TUI: - clear the spinner in test-mode sessions so idle Esc maps back to the undo hint and gate the greeting helper behind test cfg - relax the spacer regression invariant and filter the welcome bullets from replay counts so assertions reflect user-visible rows Tests: - refresh the spacer and VT100 ChatWidget snapshots to capture the new chrome and deterministic greeting layout CI: - switch release concurrency to a release-specific group without auto-cancel and declare the full permissions set required to publish - read code-rs/rust-toolchain.toml once, install via dtolnay/rust-toolchain@stable, and key rust-cache entries by the resolved channel - enforce fetch-depth: 0 on release checkouts so changelog generation, tagging, and cache keys have the full history
1 parent cfeef52 commit e8c6664

25 files changed

+392
-195
lines changed

.github/workflows/release.yml

Lines changed: 73 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,24 @@ on:
1818
- 'codex-cli/package.json'
1919

2020
concurrency:
21-
group: ci-${{ github.ref }}
22-
cancel-in-progress: true
21+
group: release-${{ github.ref_name }}
22+
cancel-in-progress: false
2323

2424
permissions:
2525
contents: write
26+
actions: read
27+
packages: write
28+
id-token: write
29+
deployments: write
30+
issues: write
31+
pull-requests: write
32+
discussions: write
33+
statuses: write
34+
attestations: write
35+
checks: read
36+
security-events: write
37+
pages: read
38+
repository-projects: read
2639

2740
jobs:
2841
preflight-tests:
@@ -33,19 +46,35 @@ jobs:
3346
steps:
3447
- name: Checkout code
3548
uses: actions/checkout@v4
49+
with:
50+
fetch-depth: 0
3651

37-
- name: Install Rust (1.90)
52+
- name: Read Rust toolchain channel
53+
id: rust_toolchain
3854
shell: bash
3955
run: |
40-
rustup set profile minimal
41-
rustup toolchain install 1.90.0 --profile minimal
42-
rustup default 1.90.0
56+
set -euo pipefail
57+
TOOLCHAIN=$(python3 - <<'PY'
58+
import tomllib
59+
from pathlib import Path
60+
data = tomllib.loads(Path('code-rs/rust-toolchain.toml').read_text())
61+
print(data['toolchain']['channel'])
62+
PY
63+
)
64+
echo "channel=$TOOLCHAIN" >> "$GITHUB_OUTPUT"
65+
echo "RUST_TOOLCHAIN=$TOOLCHAIN" >> "$GITHUB_ENV"
66+
67+
- name: Install Rust toolchain
68+
uses: dtolnay/rust-toolchain@stable
69+
with:
70+
toolchain: ${{ steps.rust_toolchain.outputs.channel }}
71+
profile: minimal
4372

4473
- name: Setup Rust Cache
4574
uses: Swatinem/rust-cache@v2
4675
with:
4776
prefix-key: v5-rust
48-
shared-key: code-preflight-1.90
77+
shared-key: code-preflight-${{ steps.rust_toolchain.outputs.channel }}
4978
workspaces: |
5079
code-rs -> target
5180
cache-targets: false
@@ -177,22 +206,38 @@ jobs:
177206
steps:
178207
- name: Checkout code
179208
uses: actions/checkout@v4
209+
with:
210+
fetch-depth: 0
180211

181-
- name: Install Rust (minimal)
212+
- name: Read Rust toolchain channel
213+
id: rust_toolchain
182214
shell: bash
183215
run: |
184-
rustup set profile minimal
185-
rustup toolchain install 1.90.0 --profile minimal
186-
rustup default 1.90.0
187-
rustup target add ${{ matrix.target }}
216+
set -euo pipefail
217+
TOOLCHAIN=$(python3 - <<'PY'
218+
import tomllib
219+
from pathlib import Path
220+
data = tomllib.loads(Path('code-rs/rust-toolchain.toml').read_text())
221+
print(data['toolchain']['channel'])
222+
PY
223+
)
224+
echo "channel=$TOOLCHAIN" >> "$GITHUB_OUTPUT"
225+
echo "RUST_TOOLCHAIN=$TOOLCHAIN" >> "$GITHUB_ENV"
226+
227+
- name: Install Rust toolchain
228+
uses: dtolnay/rust-toolchain@stable
229+
with:
230+
toolchain: ${{ steps.rust_toolchain.outputs.channel }}
231+
profile: minimal
232+
targets: ${{ matrix.target }}
188233

189234
# Keep target/ across runs so Cargo can no-op when code hasn't changed
190235
- id: rust_cache
191236
name: Setup Rust Cache (target + registries)
192237
uses: Swatinem/rust-cache@v2
193238
with:
194239
prefix-key: v5-rust
195-
shared-key: code-${{ matrix.target }}-toolchain-1.90
240+
shared-key: code-${{ matrix.target }}-toolchain-${{ steps.rust_toolchain.outputs.channel }}
196241
workspaces: |
197242
code-rs -> target
198243
cache-targets: true
@@ -343,6 +388,11 @@ jobs:
343388
Remove-Item $src -Force
344389
}
345390
391+
- name: Install zstd (Linux)
392+
if: contains(matrix.os, 'ubuntu')
393+
shell: bash
394+
run: sudo apt-get update -qq && sudo apt-get install -y zstd
395+
346396
- name: Compress artifacts (Linux dual-format)
347397
if: contains(matrix.os, 'ubuntu')
348398
shell: bash
@@ -441,6 +491,11 @@ jobs:
441491
# Show what we collected
442492
ls -la release-assets/ || true
443493
494+
- name: Install zstd (package assembly)
495+
if: runner.os == 'Linux'
496+
shell: bash
497+
run: sudo apt-get update -qq && sudo apt-get install -y zstd
498+
444499
- name: Build per-target npm binary packages
445500
shell: bash
446501
env:
@@ -591,6 +646,11 @@ jobs:
591646
# - Review changes between the previous tag and the new version
592647
# - Update CHANGELOG.md with a new section for vNEW_VERSION
593648
# - Write rich release notes to release-notes/RELEASE_NOTES.md
649+
- name: Install zstd (CHANGELOG generation)
650+
if: runner.os == 'Linux' && env.OPENAI_API_KEY != ''
651+
shell: bash
652+
run: sudo apt-get update -qq && sudo apt-get install -y zstd
653+
594654
- name: Generate CHANGELOG + release notes (Code)
595655
if: env.OPENAI_API_KEY != ''
596656
shell: bash

0 commit comments

Comments
 (0)