-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (83 loc) · 3.46 KB
/
Copy pathcodex-runtime.yml
File metadata and controls
86 lines (83 loc) · 3.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Build Codex runtimes
on:
workflow_dispatch:
permissions:
contents: read
jobs:
runtime:
name: Codex ${{ matrix.engine_target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
engine_target: win32-x64
executable: codex.exe
- os: windows-11-arm
engine_target: win32-arm64
executable: codex.exe
- os: macos-15-intel
engine_target: darwin-x64
executable: codex
- os: macos-14
engine_target: darwin-arm64
executable: codex
- os: ubuntu-24.04
engine_target: linux-x64
executable: codex
- os: ubuntu-24.04-arm
engine_target: linux-arm64
executable: codex
steps:
- name: Checkout Mcode manifests
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
- name: Checkout pinned Codex source
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
repository: openai/codex
ref: fcbdb57851be70192fd0c21faa9e529146e93ff1
path: codex-upstream
persist-credentials: false
- name: Install pinned Rust toolchain
uses: dtolnay/rust-toolchain@e081816240890017053eacbb1bdf337761dc5582
with:
toolchain: 1.95.0
- name: Build Codex CLI/app-server
shell: pwsh
run: cargo build --locked --release --manifest-path codex-upstream/codex-rs/Cargo.toml --bin codex
- name: Verify and stage runtime
shell: pwsh
run: |
$manifest = Get-Content -Raw upstream/codex-runtime.json | ConvertFrom-Json
$binary = Join-Path 'codex-upstream/codex-rs/target/release' '${{ matrix.executable }}'
if (-not (Test-Path -LiteralPath $binary)) { throw "Missing Codex binary: $binary" }
$version = (& $binary --version).Trim()
if ($version -ne "codex-cli $($manifest.version)") {
throw "Expected codex-cli $($manifest.version), found $version"
}
$output = Join-Path 'runtime-artifact' '${{ matrix.engine_target }}'
New-Item -ItemType Directory -Path $output -Force | Out-Null
Copy-Item -LiteralPath $binary -Destination (Join-Path $output '${{ matrix.executable }}')
Copy-Item -LiteralPath 'codex-upstream/LICENSE' -Destination (Join-Path $output 'LICENSE')
$hash = (Get-FileHash -LiteralPath (Join-Path $output '${{ matrix.executable }}') -Algorithm SHA256).Hash.ToLowerInvariant()
$size = (Get-Item -LiteralPath (Join-Path $output '${{ matrix.executable }}')).Length
[ordered]@{
version = $manifest.version
tag = $manifest.tag
commit = $manifest.commit
target = '${{ matrix.engine_target }}'
executable = '${{ matrix.executable }}'
size = $size
sha256 = $hash
} | ConvertTo-Json | Set-Content -LiteralPath (Join-Path $output 'runtime.json') -Encoding utf8
Write-Output "Codex $($manifest.version) / ${{ matrix.engine_target }} / $size / $hash"
- name: Upload verified runtime
uses: actions/upload-artifact@v4
with:
name: codex-runtime-${{ matrix.engine_target }}
path: runtime-artifact/${{ matrix.engine_target }}
if-no-files-found: error
retention-days: 14