Skip to content

Commit f59e9be

Browse files
committed
feat: reapply rust-v0.104.0 customizations on rust-v0.106.0
1 parent 46212e1 commit f59e9be

File tree

22 files changed

+1371
-253
lines changed

22 files changed

+1371
-253
lines changed

.agents/skills/codex-upstream-reapply/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ bash .agents/skills/codex-upstream-reapply/scripts/start_from_tag.sh \
6767
- 变更文件清单、diff patch、commit 列表
6868
-(默认)复制所有“变更过的 Markdown 意图文档”的旧版内容到 bundle 里
6969
-(可选)用 `--copy-all` 复制所有变更文件的旧版内容(用于离线阅读)
70-
并且会把 `OLD_BRANCH``README.md``CHANGED.md``.agents/skills/` 原样复制到 `NEW_BRANCH`(不改内容;如有差异会自动提交一次)。
70+
并且会把 `OLD_BRANCH``README.md``CHANGED.md``scripts/``.github/workflows/ci.yml``.agents/skills/` 原样复制到 `NEW_BRANCH`(不改内容;如有差异会自动提交一次)。
7171

7272
如果基线推断可疑(脚本会提示),请显式指定旧分支基线 tag:
7373

.agents/skills/codex-upstream-reapply/scripts/start_from_tag.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,16 +210,18 @@ echo "[INFO] Creating re-implementation bundle..."
210210
echo "[INFO] Creating new branch ${NEW_BRANCH} from tag ${TAG}..."
211211
git switch -c "${NEW_BRANCH}" "${TAG}"
212212

213-
echo "[INFO] Copying README.md, CHANGED.md, and .agents/skills from ${OLD_BRANCH} (no modifications)..."
213+
echo "[INFO] Copying README.md, CHANGED.md, scripts/, .github/workflows/ci.yml, and .agents/skills from ${OLD_BRANCH} (no modifications)..."
214214
copy_file_from_old_branch "${OLD_BRANCH}" "README.md"
215215
copy_file_from_old_branch "${OLD_BRANCH}" "CHANGED.md"
216+
copy_path_from_old_branch "${OLD_BRANCH}" "scripts"
217+
copy_path_from_old_branch "${OLD_BRANCH}" ".github/workflows/ci.yml"
216218
copy_path_from_old_branch "${OLD_BRANCH}" ".agents/skills"
217219
if ! git diff --cached --quiet; then
218-
if git commit -m "docs: copy README.md, CHANGED.md, and .agents/skills from ${OLD_BRANCH}"; then
219-
echo "[OK] Committed README.md, CHANGED.md, and .agents/skills copy"
220+
if git commit -m "docs: copy README.md, CHANGED.md, scripts, ci.yml, and .agents/skills from ${OLD_BRANCH}"; then
221+
echo "[OK] Committed README.md, CHANGED.md, scripts, ci.yml, and .agents/skills copy"
220222
else
221223
echo "[WARN] Unable to commit copied docs/skills (git user.name/user.email?)."
222-
echo "[WARN] Commit manually with: git commit -m \"docs: copy README.md, CHANGED.md, and .agents/skills from ${OLD_BRANCH}\""
224+
echo "[WARN] Commit manually with: git commit -m \"docs: copy README.md, CHANGED.md, scripts, ci.yml, and .agents/skills from ${OLD_BRANCH}\""
223225
fi
224226
fi
225227

.github/workflows/ci.yml

Lines changed: 119 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,139 @@
11
name: ci
22

33
on:
4-
pull_request: {}
5-
push: { branches: [main] }
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch: {}
8+
9+
permissions:
10+
contents: write
11+
12+
concurrency:
13+
group: ci-main-release-${{ github.ref }}
14+
cancel-in-progress: true
615

716
jobs:
8-
build-test:
17+
metadata:
18+
name: Resolve Release Metadata
919
runs-on: ubuntu-latest
10-
timeout-minutes: 10
11-
env:
12-
NODE_OPTIONS: --max-old-space-size=4096
20+
outputs:
21+
base_version: ${{ steps.meta.outputs.base_version }}
22+
release_tag: ${{ steps.meta.outputs.release_tag }}
1323
steps:
14-
- name: Checkout repository
24+
- name: Checkout
1525
uses: actions/checkout@v6
1626

17-
- name: Setup pnpm
18-
uses: pnpm/action-setup@v4
19-
with:
20-
run_install: false
27+
- name: Resolve version/tag
28+
id: meta
29+
shell: bash
30+
run: |
31+
set -euo pipefail
32+
base_version="$(grep -m1 '^version' codex-rs/Cargo.toml | sed -E 's/version *= *\"([^\"]+)\".*/\1/')"
33+
release_tag="v${base_version}"
2134
22-
- name: Setup Node.js
23-
uses: actions/setup-node@v6
24-
with:
25-
node-version: 22
35+
echo "base_version=${base_version}" >> "$GITHUB_OUTPUT"
36+
echo "release_tag=${release_tag}" >> "$GITHUB_OUTPUT"
2637
27-
- name: Install dependencies
28-
run: pnpm install --frozen-lockfile
38+
build-binaries:
39+
name: Build ${{ matrix.target }}
40+
needs: metadata
41+
runs-on: ${{ matrix.os }}
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
include:
46+
- os: ubuntu-latest
47+
target: x86_64-unknown-linux-gnu
48+
archive_name: codex-x86_64-unknown-linux-gnu.tar.gz
49+
binary_name: codex
50+
- os: macos-latest
51+
target: aarch64-apple-darwin
52+
archive_name: codex-aarch64-apple-darwin.tar.gz
53+
binary_name: codex
54+
- os: windows-latest
55+
target: x86_64-pc-windows-msvc
56+
archive_name: codex-x86_64-pc-windows-msvc.zip
57+
binary_name: codex.exe
58+
defaults:
59+
run:
60+
working-directory: codex-rs
61+
steps:
62+
- name: Checkout
63+
uses: actions/checkout@v6
64+
65+
- name: Install Linux build dependencies
66+
if: ${{ runner.os == 'Linux' }}
67+
shell: bash
68+
run: |
69+
set -euo pipefail
70+
sudo apt-get update
71+
sudo apt-get install -y --no-install-recommends pkg-config libcap-dev
2972
30-
# stage_npm_packages.py requires DotSlash when staging releases.
31-
- uses: facebook/install-dotslash@v2
73+
- name: Install Rust toolchain
74+
uses: dtolnay/rust-toolchain@stable
75+
with:
76+
targets: ${{ matrix.target }}
3277

33-
- name: Stage npm package
34-
id: stage_npm_package
35-
env:
36-
GH_TOKEN: ${{ github.token }}
78+
- name: Build codex
79+
shell: bash
3780
run: |
3881
set -euo pipefail
39-
# Use a rust-release version that includes all native binaries.
40-
CODEX_VERSION=0.74.0
41-
OUTPUT_DIR="${RUNNER_TEMP}"
42-
python3 ./scripts/stage_npm_packages.py \
43-
--release-version "$CODEX_VERSION" \
44-
--package codex \
45-
--output-dir "$OUTPUT_DIR"
46-
PACK_OUTPUT="${OUTPUT_DIR}/codex-npm-${CODEX_VERSION}.tgz"
47-
echo "pack_output=$PACK_OUTPUT" >> "$GITHUB_OUTPUT"
48-
49-
- name: Upload staged npm package artifact
82+
cargo build --release --target "${{ matrix.target }}" --bin codex
83+
84+
- name: Package artifact (Unix)
85+
if: ${{ runner.os != 'Windows' }}
86+
shell: bash
87+
run: |
88+
set -euo pipefail
89+
mkdir -p dist
90+
cp "target/${{ matrix.target }}/release/${{ matrix.binary_name }}" .
91+
tar -czf "dist/${{ matrix.archive_name }}" "${{ matrix.binary_name }}"
92+
93+
- name: Package artifact (Windows)
94+
if: ${{ runner.os == 'Windows' }}
95+
shell: pwsh
96+
run: |
97+
New-Item -ItemType Directory -Path dist -Force | Out-Null
98+
Copy-Item "target/${{ matrix.target }}/release/${{ matrix.binary_name }}" "${{ matrix.binary_name }}" -Force
99+
Compress-Archive -Path "${{ matrix.binary_name }}" -DestinationPath "dist/${{ matrix.archive_name }}" -Force
100+
101+
- name: Upload artifact
50102
uses: actions/upload-artifact@v6
51103
with:
52-
name: codex-npm-staging
53-
path: ${{ steps.stage_npm_package.outputs.pack_output }}
104+
name: release-${{ matrix.target }}
105+
path: codex-rs/dist/${{ matrix.archive_name }}
106+
107+
github-release:
108+
name: Publish GitHub Release
109+
needs: [metadata, build-binaries]
110+
runs-on: ubuntu-latest
111+
steps:
112+
- name: Download artifacts
113+
uses: actions/download-artifact@v6
114+
with:
115+
pattern: release-*
116+
merge-multiple: true
117+
path: dist
54118

55-
- name: Ensure root README.md contains only ASCII and certain Unicode code points
56-
run: ./scripts/asciicheck.py README.md
57-
- name: Check root README ToC
58-
run: python3 scripts/readme_toc.py README.md
119+
- name: Create release notes
120+
shell: bash
121+
run: |
122+
set -euo pipefail
123+
cat > release-notes.md <<'EOF'
124+
Automated main-branch release for Codex CLI.
59125
60-
- name: Ensure codex-cli/README.md contains only ASCII and certain Unicode code points
61-
run: ./scripts/asciicheck.py codex-cli/README.md
62-
- name: Check codex-cli/README ToC
63-
run: python3 scripts/readme_toc.py codex-cli/README.md
126+
Includes binaries for:
127+
- macOS (Apple Silicon)
128+
- Linux (x86_64)
129+
- Windows (x86_64)
130+
EOF
64131
65-
- name: Prettier (run `pnpm run format:fix` to fix)
66-
run: pnpm run format
132+
- name: Create GitHub Release
133+
uses: softprops/action-gh-release@v2
134+
with:
135+
tag_name: ${{ needs.metadata.outputs.release_tag }}
136+
name: v${{ needs.metadata.outputs.base_version }}
137+
body_path: release-notes.md
138+
prerelease: ${{ contains(needs.metadata.outputs.base_version, '-') }}
139+
files: dist/*

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Codex
22

3-
![Codex build](https://img.shields.io/static/v1?label=codex%20build&message=v0.104.0-10553fa&color=2ea043)
3+
![Codex build](https://img.shields.io/static/v1?label=codex%20build&message=rust-v0.106.0-7ff67f2&color=2ea043)
44

55
![TUI](
66
https://github.com/user-attachments/assets/127abbc2-cb30-4d6e-8a81-ce707260c045)

0 commit comments

Comments
 (0)