From a26f1da70fc0cf09326b9504d2a7a0bbe36aa529 Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 14:50:41 -0700 Subject: [PATCH 01/48] no component nonsense --- .github/workflows/rust-release.yml | 82 ++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 .github/workflows/rust-release.yml diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml new file mode 100644 index 00000000000..f75da546bfe --- /dev/null +++ b/.github/workflows/rust-release.yml @@ -0,0 +1,82 @@ +name: rust-ci +on: + pull_request: + branches: + - main + paths: + - "codex-rs/**" + push: + tags: + - "v.*.*.*" + + # remove before landing + workflow_dispatch: + +jobs: + + release: + name: ${{ matrix.runner }} - ${{ matrix.target }} + runs-on: ${{ matrix.runner }} + timeout-minutes: 30 + defaults: + run: + working-directory: codex-rs + + strategy: + fail-fast: false + matrix: + include: + - runner: macos-14 + target: aarch64-apple-darwin + - runner: macos-14 + target: x86_64-apple-darwin + - runner: ubuntu-24.04 + target: x86_64-unknown-linux-musl + - runner: ubuntu-24.04 + target: x86_64-unknown-linux-gnu + + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ matrix.target }} + + - uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + ${{ github.workspace }}/codex-rs/target/ + key: cargo-${{ matrix.runner }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }} + + - if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }} + name: Install musl build tools + run: | + sudo apt install -y musl-tools pkg-config + + - name: Initialize failure flag + run: echo "FAILED=" >> $GITHUB_ENV + + - name: cargo build + run: cargo build --target ${{ matrix.target }} --release --all-features -- -D warnings || echo "FAILED=${FAILED:+$FAILED, }cargo clippy" >> $GITHUB_ENV + + - name: upload + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.runner }}-${{ matrix.target }} + path: dist/* + + - name: release + uses: softprops/action-gh-release@v2 + with: { files: dist/* } + + - name: Fail if any step failed + run: | + if [ -n "$FAILED" ]; then + echo -e "See logs above, as the following steps failed:\n$FAILED" + exit 1 + fi + env: + FAILED: ${{ env.FAILED }} From 5e229b1cebeed269372c00ca701eb2e7fa7192dc Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 14:51:55 -0700 Subject: [PATCH 02/48] fix --- .github/workflows/rust-release.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index f75da546bfe..eacf49453c1 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -1,13 +1,8 @@ name: rust-ci on: - pull_request: - branches: - - main - paths: - - "codex-rs/**" push: tags: - - "v.*.*.*" + - "rust-v.*.*.*" # remove before landing workflow_dispatch: From 8d8024d71a12035246512bb032a0585268f12f16 Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 14:52:26 -0700 Subject: [PATCH 03/48] fix name --- .github/workflows/rust-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index eacf49453c1..048a08a5715 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -1,4 +1,4 @@ -name: rust-ci +name: rust-release on: push: tags: From 5380288547551693e098c156bfb361fbd3a32b39 Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 14:58:26 -0700 Subject: [PATCH 04/48] test --- .github/workflows/rust-release.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index 048a08a5715..032920ed591 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -9,7 +9,7 @@ on: jobs: - release: + build: name: ${{ matrix.runner }} - ${{ matrix.target }} runs-on: ${{ matrix.runner }} timeout-minutes: 30 @@ -63,10 +63,6 @@ jobs: name: ${{ matrix.runner }}-${{ matrix.target }} path: dist/* - - name: release - uses: softprops/action-gh-release@v2 - with: { files: dist/* } - - name: Fail if any step failed run: | if [ -n "$FAILED" ]; then @@ -75,3 +71,14 @@ jobs: fi env: FAILED: ${{ env.FAILED }} + + release: + needs: build + name: release + runs-on: ubuntu-24.04 + + steps: + - uses: actions:/download-artifact@v4 + with: + name: test + path: dist/ From 6d33a66ceac7c4da14f6fc5fffd187a9e78ecf46 Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 15:03:54 -0700 Subject: [PATCH 05/48] test --- .github/workflows/rust-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index 032920ed591..5ab8fa7fcee 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -60,7 +60,7 @@ jobs: - name: upload uses: actions/upload-artifact@v4 with: - name: ${{ matrix.runner }}-${{ matrix.target }} + name: ${{ matrix.target }} path: dist/* - name: Fail if any step failed @@ -80,5 +80,5 @@ jobs: steps: - uses: actions:/download-artifact@v4 with: - name: test + name: x86_64-unknown-linux-musl path: dist/ From c4ba9608bd9df434bba5e5430907c3d28259a2f4 Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 15:07:18 -0700 Subject: [PATCH 06/48] test --- .github/workflows/rust-release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index 5ab8fa7fcee..e51c393b5f2 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -78,7 +78,7 @@ jobs: runs-on: ubuntu-24.04 steps: - - uses: actions:/download-artifact@v4 + - name: download + uses: actions:/download-artifact@v4 with: - name: x86_64-unknown-linux-musl - path: dist/ + path: dist/* From 62b0639342051070d44f3cd6357b6e8a66461cc7 Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 15:09:23 -0700 Subject: [PATCH 07/48] remove clippy flags --- .github/workflows/rust-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index e51c393b5f2..42c917a46c7 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -55,7 +55,7 @@ jobs: run: echo "FAILED=" >> $GITHUB_ENV - name: cargo build - run: cargo build --target ${{ matrix.target }} --release --all-features -- -D warnings || echo "FAILED=${FAILED:+$FAILED, }cargo clippy" >> $GITHUB_ENV + run: cargo build --target ${{ matrix.target }} --release --all-features || echo "FAILED=${FAILED:+$FAILED, }cargo clippy" >> $GITHUB_ENV - name: upload uses: actions/upload-artifact@v4 From e4339db8a8aac7b218108920b04747115067316e Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 15:11:11 -0700 Subject: [PATCH 08/48] fix --- .github/workflows/rust-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index 42c917a46c7..4aabfac4947 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -55,7 +55,7 @@ jobs: run: echo "FAILED=" >> $GITHUB_ENV - name: cargo build - run: cargo build --target ${{ matrix.target }} --release --all-features || echo "FAILED=${FAILED:+$FAILED, }cargo clippy" >> $GITHUB_ENV + run: cargo build --target ${{ matrix.target }} --release --all-features || echo "FAILED=${FAILED:+$FAILED, }cargo build" >> $GITHUB_ENV - name: upload uses: actions/upload-artifact@v4 From ba6c2e5849294e94e64c2a52037638d804bfbf67 Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 15:13:16 -0700 Subject: [PATCH 09/48] fail fast --- .github/workflows/rust-release.yml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index 4aabfac4947..c0506bf596f 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -51,11 +51,8 @@ jobs: run: | sudo apt install -y musl-tools pkg-config - - name: Initialize failure flag - run: echo "FAILED=" >> $GITHUB_ENV - - name: cargo build - run: cargo build --target ${{ matrix.target }} --release --all-features || echo "FAILED=${FAILED:+$FAILED, }cargo build" >> $GITHUB_ENV + run: cargo build --target ${{ matrix.target }} --release --all-features - name: upload uses: actions/upload-artifact@v4 @@ -63,15 +60,6 @@ jobs: name: ${{ matrix.target }} path: dist/* - - name: Fail if any step failed - run: | - if [ -n "$FAILED" ]; then - echo -e "See logs above, as the following steps failed:\n$FAILED" - exit 1 - fi - env: - FAILED: ${{ env.FAILED }} - release: needs: build name: release From a8f1d53430d011d8e4afada00ff7dd8babcd1b3f Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 15:15:47 -0700 Subject: [PATCH 10/48] target bins --- .github/workflows/rust-release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index c0506bf596f..2032bad067e 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -52,13 +52,13 @@ jobs: sudo apt install -y musl-tools pkg-config - name: cargo build - run: cargo build --target ${{ matrix.target }} --release --all-features + run: cargo build --target ${{ matrix.target }} --release --all-targets --all-features - name: upload uses: actions/upload-artifact@v4 with: name: ${{ matrix.target }} - path: dist/* + path: target/release/codex-* release: needs: build @@ -69,4 +69,4 @@ jobs: - name: download uses: actions:/download-artifact@v4 with: - path: dist/* + path: target/release/* From e24fe6a00628d40a52f5dbc15e22b2d3c7381c7b Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 15:24:22 -0700 Subject: [PATCH 11/48] stage artifacts --- .github/workflows/rust-release.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index 2032bad067e..78d6e17f149 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -53,12 +53,20 @@ jobs: - name: cargo build run: cargo build --target ${{ matrix.target }} --release --all-targets --all-features + + - name: stage artifacts + shell: bash + run: | + dest="dist/${{ matrix.target }}" + mkdir -p "$dest" + shopt -s nullglob + cp target/${{ matrix.target }}/release/codex-* "$dest/" - name: upload uses: actions/upload-artifact@v4 with: name: ${{ matrix.target }} - path: target/release/codex-* + path: dist/${{ matrix.target }} release: needs: build @@ -66,7 +74,6 @@ jobs: runs-on: ubuntu-24.04 steps: - - name: download - uses: actions:/download-artifact@v4 + - uses: actions:/download-artifact@v4 with: - path: target/release/* + path: dist From 57634e98b23a7764bf9f0bdd8c71a0369bc65e36 Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 15:28:20 -0700 Subject: [PATCH 12/48] cargo-release prefix --- .github/workflows/rust-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index 78d6e17f149..25e29fff93c 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -44,7 +44,7 @@ jobs: ~/.cargo/registry/cache/ ~/.cargo/git/db/ ${{ github.workspace }}/codex-rs/target/ - key: cargo-${{ matrix.runner }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }} + key: cargo-release-${{ matrix.runner }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }} - if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }} name: Install musl build tools From 011bf6f9ee1e143721f619a192391ee900bcb533 Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 15:29:15 -0700 Subject: [PATCH 13/48] prettier --- .github/workflows/rust-release.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index 25e29fff93c..956c8a8777e 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -8,7 +8,6 @@ on: workflow_dispatch: jobs: - build: name: ${{ matrix.runner }} - ${{ matrix.target }} runs-on: ${{ matrix.runner }} @@ -53,7 +52,7 @@ jobs: - name: cargo build run: cargo build --target ${{ matrix.target }} --release --all-targets --all-features - + - name: stage artifacts shell: bash run: | @@ -61,7 +60,7 @@ jobs: mkdir -p "$dest" shopt -s nullglob cp target/${{ matrix.target }}/release/codex-* "$dest/" - + - name: upload uses: actions/upload-artifact@v4 with: @@ -74,6 +73,6 @@ jobs: runs-on: ubuntu-24.04 steps: - - uses: actions:/download-artifact@v4 - with: - path: dist + - uses: actions:/download-artifact@v4 + with: + path: dist From 1b367bb2f6bb69e0941da015c266154eb57e1ca5 Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 15:31:49 -0700 Subject: [PATCH 14/48] cancel in progress --- .github/workflows/rust-release.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index 956c8a8777e..196201ce365 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -7,6 +7,10 @@ on: # remove before landing workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: build: name: ${{ matrix.runner }} - ${{ matrix.target }} From 43dfdfbe1f65782cfc87cadf3533e0c02d941dda Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 15:33:01 -0700 Subject: [PATCH 15/48] fix typo --- .github/workflows/rust-release.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index 196201ce365..23ec4cd60f0 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -77,6 +77,9 @@ jobs: runs-on: ubuntu-24.04 steps: - - uses: actions:/download-artifact@v4 + - uses: actions/download-artifact@v4 with: path: dist + + - name: list + run: ls dist/ From e771d5aa3749179083c156eb0d0db7e2d40fc416 Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 15:34:27 -0700 Subject: [PATCH 16/48] prettier --- .github/workflows/rust-release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index 23ec4cd60f0..26bfe5bb412 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -8,8 +8,8 @@ on: workflow_dispatch: concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: build: @@ -80,6 +80,6 @@ jobs: - uses: actions/download-artifact@v4 with: path: dist - + - name: list run: ls dist/ From 37bad9db4b9ae140c3a2465da122365dec276c98 Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 15:36:08 -0700 Subject: [PATCH 17/48] arm --- .github/workflows/rust-release.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index 26bfe5bb412..48f9a29554a 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -32,6 +32,10 @@ jobs: target: x86_64-unknown-linux-musl - runner: ubuntu-24.04 target: x86_64-unknown-linux-gnu + - runner: ubuntu-24.04-arm + target: aarch64-unknown-linux-gnu + - runner: ubuntu-24.04-arm + target: aarch64-unknown-linux-musl steps: - uses: actions/checkout@v4 From 3241df4f6c87bb416e5466a9e956ba50a09d50a8 Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 15:39:00 -0700 Subject: [PATCH 18/48] test --- .github/workflows/rust-release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index 48f9a29554a..9c481111ed1 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -65,6 +65,8 @@ jobs: shell: bash run: | dest="dist/${{ matrix.target }}" + ls -R + echo $dest mkdir -p "$dest" shopt -s nullglob cp target/${{ matrix.target }}/release/codex-* "$dest/" From 47f6bf12a401e739d242d2094dd5d1d528531202 Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 15:44:58 -0700 Subject: [PATCH 19/48] test --- .github/workflows/rust-release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index 9c481111ed1..3e0a69af8e0 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -65,11 +65,11 @@ jobs: shell: bash run: | dest="dist/${{ matrix.target }}" - ls -R - echo $dest mkdir -p "$dest" shopt -s nullglob - cp target/${{ matrix.target }}/release/codex-* "$dest/" + cp target/${{ matrix.target }}/release/codex-repl "$dest" + cp target/${{ matrix.target }}/release/codex-tui "$dest" + ls -R dist/ - name: upload uses: actions/upload-artifact@v4 From de54bbfbc8d24283a9bb1a984cdcc56121d2e597 Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 15:46:03 -0700 Subject: [PATCH 20/48] include libssl-dev --- .github/workflows/rust-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index 3e0a69af8e0..3d95c88a7e4 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -56,7 +56,7 @@ jobs: - if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }} name: Install musl build tools run: | - sudo apt install -y musl-tools pkg-config + sudo apt install -y musl-tools pkg-config libssl-dev - name: cargo build run: cargo build --target ${{ matrix.target }} --release --all-targets --all-features From eabd31726a8507309010608f364dcc1c63ddcd2a Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 15:47:23 -0700 Subject: [PATCH 21/48] glob --- .github/workflows/rust-release.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index 3d95c88a7e4..4c5424ffc06 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -69,13 +69,11 @@ jobs: shopt -s nullglob cp target/${{ matrix.target }}/release/codex-repl "$dest" cp target/${{ matrix.target }}/release/codex-tui "$dest" - ls -R dist/ - name: upload uses: actions/upload-artifact@v4 with: - name: ${{ matrix.target }} - path: dist/${{ matrix.target }} + path: dist/* release: needs: build From cb3ee4ae3beec77da08ec3380429a7144c4038d9 Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 15:51:04 -0700 Subject: [PATCH 22/48] debugging --- .github/workflows/rust-release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index 4c5424ffc06..e5759e5340a 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -69,11 +69,12 @@ jobs: shopt -s nullglob cp target/${{ matrix.target }}/release/codex-repl "$dest" cp target/${{ matrix.target }}/release/codex-tui "$dest" + ls -lah "$dest" - name: upload uses: actions/upload-artifact@v4 with: - path: dist/* + path: dist/${{ matrix.target }} release: needs: build From b13e57e6fb6a862e3b0258bded309f66f5e84840 Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 15:53:20 -0700 Subject: [PATCH 23/48] one artifact per line --- .github/workflows/rust-release.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index e5759e5340a..3ee186a5564 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -74,7 +74,12 @@ jobs: - name: upload uses: actions/upload-artifact@v4 with: - path: dist/${{ matrix.target }} + path: dist/${{ matrix.target }}/codex-repl + + - name: upload + uses: actions/upload-artifact@v4 + with: + path: dist/${{ matrix.target }}/codex-tui release: needs: build From 56addbc01c3c91c9c41f7507bb56ec5e844795ae Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 15:56:25 -0700 Subject: [PATCH 24/48] try static ssl on musl build --- .github/workflows/rust-release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index 3ee186a5564..650a69d3cd4 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -57,6 +57,7 @@ jobs: name: Install musl build tools run: | sudo apt install -y musl-tools pkg-config libssl-dev + echo "OPENSSL_STATIC=1" >> "$GITHUB_ENV" - name: cargo build run: cargo build --target ${{ matrix.target }} --release --all-targets --all-features From 8ae8a646df0bc6b19f52077b342916f749ae89b3 Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 16:00:01 -0700 Subject: [PATCH 25/48] fix path --- .github/workflows/rust-release.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index 650a69d3cd4..8a3520db441 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -72,15 +72,11 @@ jobs: cp target/${{ matrix.target }}/release/codex-tui "$dest" ls -lah "$dest" - - name: upload - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v4 with: - path: dist/${{ matrix.target }}/codex-repl + name: ${{ matrix.target }} + path: codex-rs/dist/${{ matrix.target }}/* - - name: upload - uses: actions/upload-artifact@v4 - with: - path: dist/${{ matrix.target }}/codex-tui release: needs: build From 4f499a41670225522166df926e6f5ecb55d5d17a Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 16:05:52 -0700 Subject: [PATCH 26/48] vendor ssl for arm --- .github/workflows/rust-release.yml | 9 ++++----- codex-rs/core/Cargo.toml | 3 +++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index 8a3520db441..22158646b43 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -56,13 +56,12 @@ jobs: - if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }} name: Install musl build tools run: | - sudo apt install -y musl-tools pkg-config libssl-dev - echo "OPENSSL_STATIC=1" >> "$GITHUB_ENV" + sudo apt install -y musl-tools pkg-config - - name: cargo build + - name: Cargo build run: cargo build --target ${{ matrix.target }} --release --all-targets --all-features - - name: stage artifacts + - name: Stage artifacts shell: bash run: | dest="dist/${{ matrix.target }}" @@ -88,5 +87,5 @@ jobs: with: path: dist - - name: list + - name: List run: ls dist/ diff --git a/codex-rs/core/Cargo.toml b/codex-rs/core/Cargo.toml index 778362d275a..8806bda8470 100644 --- a/codex-rs/core/Cargo.toml +++ b/codex-rs/core/Cargo.toml @@ -49,6 +49,9 @@ seccompiler = "0.5.0" [target.x86_64-unknown-linux-musl.dependencies] openssl-sys = { version = "*", features = ["vendored"] } +[target.aarch64-unknown-linux-musl.dependencies] +openssl-sys = { version = "*", features = ["vendored"] } + [dev-dependencies] assert_cmd = "2" predicates = "3" From c7430ff09d16b679ed09dd1d2d15fdbb7382d7a8 Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 16:09:13 -0700 Subject: [PATCH 27/48] musl fix --- .github/workflows/rust-release.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index 22158646b43..aa2aac5ec39 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -58,6 +58,21 @@ jobs: run: | sudo apt install -y musl-tools pkg-config + - if: matrix.target == 'aarch64-unknown-linux-musl' + name: Install aarch64-musl toolchain + run: | + sudo apt-get update + curl -LO https://musl.cc/aarch64-linux-musl-cross.tgz + sudo tar -C /usr/local -xzf aarch64-linux-musl-cross.tgz + echo "/usr/local/aarch64-linux-musl-cross/bin" >> "$GITHUB_PATH" + + # tell Cargo which compiler/archiver to use + { + echo "CC_aarch64_unknown_linux_musl=aarch64-linux-musl-gcc" + echo "AR_aarch64_unknown_linux_musl=aarch64-linux-musl-ar" + echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-musl-gcc" + } >> "$GITHUB_ENV" + - name: Cargo build run: cargo build --target ${{ matrix.target }} --release --all-targets --all-features From 6f25cf27d4f9a0139aed2385b1390ccf505d6ff8 Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 16:09:23 -0700 Subject: [PATCH 28/48] prettier --- .github/workflows/rust-release.yml | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index aa2aac5ec39..46ead481cd6 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -61,17 +61,17 @@ jobs: - if: matrix.target == 'aarch64-unknown-linux-musl' name: Install aarch64-musl toolchain run: | - sudo apt-get update - curl -LO https://musl.cc/aarch64-linux-musl-cross.tgz - sudo tar -C /usr/local -xzf aarch64-linux-musl-cross.tgz - echo "/usr/local/aarch64-linux-musl-cross/bin" >> "$GITHUB_PATH" - - # tell Cargo which compiler/archiver to use - { - echo "CC_aarch64_unknown_linux_musl=aarch64-linux-musl-gcc" - echo "AR_aarch64_unknown_linux_musl=aarch64-linux-musl-ar" - echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-musl-gcc" - } >> "$GITHUB_ENV" + sudo apt-get update + curl -LO https://musl.cc/aarch64-linux-musl-cross.tgz + sudo tar -C /usr/local -xzf aarch64-linux-musl-cross.tgz + echo "/usr/local/aarch64-linux-musl-cross/bin" >> "$GITHUB_PATH" + + # tell Cargo which compiler/archiver to use + { + echo "CC_aarch64_unknown_linux_musl=aarch64-linux-musl-gcc" + echo "AR_aarch64_unknown_linux_musl=aarch64-linux-musl-ar" + echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-musl-gcc" + } >> "$GITHUB_ENV" - name: Cargo build run: cargo build --target ${{ matrix.target }} --release --all-targets --all-features @@ -91,7 +91,6 @@ jobs: name: ${{ matrix.target }} path: codex-rs/dist/${{ matrix.target }}/* - release: needs: build name: release From a84ce3dc1cd48675c194b6cdeb8742027b5701db Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 16:11:31 -0700 Subject: [PATCH 29/48] drop arm musl --- .github/workflows/rust-release.yml | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index 46ead481cd6..ded5f0fb1c1 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -34,8 +34,6 @@ jobs: target: x86_64-unknown-linux-gnu - runner: ubuntu-24.04-arm target: aarch64-unknown-linux-gnu - - runner: ubuntu-24.04-arm - target: aarch64-unknown-linux-musl steps: - uses: actions/checkout@v4 @@ -58,21 +56,6 @@ jobs: run: | sudo apt install -y musl-tools pkg-config - - if: matrix.target == 'aarch64-unknown-linux-musl' - name: Install aarch64-musl toolchain - run: | - sudo apt-get update - curl -LO https://musl.cc/aarch64-linux-musl-cross.tgz - sudo tar -C /usr/local -xzf aarch64-linux-musl-cross.tgz - echo "/usr/local/aarch64-linux-musl-cross/bin" >> "$GITHUB_PATH" - - # tell Cargo which compiler/archiver to use - { - echo "CC_aarch64_unknown_linux_musl=aarch64-linux-musl-gcc" - echo "AR_aarch64_unknown_linux_musl=aarch64-linux-musl-ar" - echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-musl-gcc" - } >> "$GITHUB_ENV" - - name: Cargo build run: cargo build --target ${{ matrix.target }} --release --all-targets --all-features From 4b39f8a5f4570eb622e18cf1a5db437e6474d837 Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 16:13:53 -0700 Subject: [PATCH 30/48] testing --- .github/workflows/rust-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index ded5f0fb1c1..8d0b24f5d34 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -85,4 +85,4 @@ jobs: path: dist - name: List - run: ls dist/ + run: ls -R dist/ From c7ee0e7bfa89c8a21d2665e1ff09d94d785681ec Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 16:27:12 -0700 Subject: [PATCH 31/48] test draft release --- .github/workflows/rust-release.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index 8d0b24f5d34..e3b12a4dcfd 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -86,3 +86,9 @@ jobs: - name: List run: ls -R dist/ + + - uses: softprops/action-gh-release@v2 + with: + files: dist/** + prerelease: true + draft: true From 7b48dcb5b449dbc4d4f4c8eabe50ed18e14aeffa Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 16:28:46 -0700 Subject: [PATCH 32/48] prettier --- .github/workflows/rust-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index e3b12a4dcfd..fe6f29a14c1 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -86,9 +86,9 @@ jobs: - name: List run: ls -R dist/ - + - uses: softprops/action-gh-release@v2 - with: + with: files: dist/** prerelease: true draft: true From 680c1e33dd8d5aaf41dfab5ba929e7589b5c2f56 Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 16:29:27 -0700 Subject: [PATCH 33/48] remove unrelated musl ssl change --- codex-rs/core/Cargo.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/codex-rs/core/Cargo.toml b/codex-rs/core/Cargo.toml index 8806bda8470..778362d275a 100644 --- a/codex-rs/core/Cargo.toml +++ b/codex-rs/core/Cargo.toml @@ -49,9 +49,6 @@ seccompiler = "0.5.0" [target.x86_64-unknown-linux-musl.dependencies] openssl-sys = { version = "*", features = ["vendored"] } -[target.aarch64-unknown-linux-musl.dependencies] -openssl-sys = { version = "*", features = ["vendored"] } - [dev-dependencies] assert_cmd = "2" predicates = "3" From 2f5bb5bbc10e3bb21083cc2cec6d8eb21bbb015f Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 16:34:19 -0700 Subject: [PATCH 34/48] name artifacts --- .github/workflows/rust-release.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index fe6f29a14c1..7a6e3444b9a 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -65,9 +65,8 @@ jobs: dest="dist/${{ matrix.target }}" mkdir -p "$dest" shopt -s nullglob - cp target/${{ matrix.target }}/release/codex-repl "$dest" - cp target/${{ matrix.target }}/release/codex-tui "$dest" - ls -lah "$dest" + cp target/${{ matrix.target }}/release/codex-repl "$dest/codex-repl-${{ matrix.target }}" + cp target/${{ matrix.target }}/release/codex-tui "$dest/codex-tui-${{ matrix.target }}" - uses: actions/upload-artifact@v4 with: From d8a11dfcb43bd22e8907ef7812ebb266db8fc60e Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 16:54:02 -0700 Subject: [PATCH 35/48] dotslash step --- .github/dotslash-config.json | 22 ++++++++++++++++++++++ .github/workflows/rust-release.yml | 10 ++++++++++ 2 files changed, 32 insertions(+) create mode 100644 .github/dotslash-config.json diff --git a/.github/dotslash-config.json b/.github/dotslash-config.json new file mode 100644 index 00000000000..0049edc9e64 --- /dev/null +++ b/.github/dotslash-config.json @@ -0,0 +1,22 @@ +{ + "outputs": { + "codex-repl": { + "platforms": { + "macos-aarch64": { "regex": "^codex-repl-aarch64-apple-darwin$", "path": "codex-repl" }, + "macos-x86_64": { "regex": "^codex-repl-x86_64-apple-darwin$", "path": "codex-repl" }, + "linux-x86_64": { "regex": "^codex-repl-x86_64-unknown-linux-musl$", "path": "codex-repl" }, + "linux-aarch64": { "regex": "^codex-repl-aarch64-unknown-linux-gnu$", "path": "codex-repl" } + } + }, + + "codex-tui": { + "platforms": { + "macos-aarch64": { "regex": "^codex-tui-aarch64-apple-darwin$", "path": "codex-tui" }, + "macos-x86_64": { "regex": "^codex-tui-x86_64-apple-darwin$", "path": "codex-tui" }, + "linux-x86_64": { "regex": "^codex-tui-x86_64-unknown-linux-musl$", "path": "codex-tui" }, + "linux-aarch64": { "regex": "^codex-tui-aarch64-unknown-linux-gnu$", "path": "codex-tui" } + } + } + } + } + \ No newline at end of file diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index 7a6e3444b9a..8253cb73e23 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -78,6 +78,9 @@ jobs: name: release runs-on: ubuntu-24.04 + env: + RELEASE_TAG: ${{ github.ref_name }} + steps: - uses: actions/download-artifact@v4 with: @@ -88,6 +91,13 @@ jobs: - uses: softprops/action-gh-release@v2 with: + tag_name: ${{ env.RELEASE_TAG }} files: dist/** prerelease: true draft: true + + - uses: facebook/dotslash-publish-release@v1 + with: + tag: ${{ env.RELEASE_TAG }} + config: .github/dotslash-config.json + From 8f549cf509c1f38e00d0a072de0af1fdf6f82418 Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 16:59:43 -0700 Subject: [PATCH 36/48] token --- .github/workflows/rust-release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index 8253cb73e23..61110d5a482 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -97,6 +97,8 @@ jobs: draft: true - uses: facebook/dotslash-publish-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag: ${{ env.RELEASE_TAG }} config: .github/dotslash-config.json From 3b91488fdaa8fb27b3e38b91fa4b24d12d83479a Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 17:05:19 -0700 Subject: [PATCH 37/48] specify format for dotfile config --- .github/dotslash-config.json | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/.github/dotslash-config.json b/.github/dotslash-config.json index 0049edc9e64..bda8cb171dd 100644 --- a/.github/dotslash-config.json +++ b/.github/dotslash-config.json @@ -1,22 +1,21 @@ { - "outputs": { - "codex-repl": { - "platforms": { - "macos-aarch64": { "regex": "^codex-repl-aarch64-apple-darwin$", "path": "codex-repl" }, - "macos-x86_64": { "regex": "^codex-repl-x86_64-apple-darwin$", "path": "codex-repl" }, - "linux-x86_64": { "regex": "^codex-repl-x86_64-unknown-linux-musl$", "path": "codex-repl" }, - "linux-aarch64": { "regex": "^codex-repl-aarch64-unknown-linux-gnu$", "path": "codex-repl" } - } - }, - - "codex-tui": { - "platforms": { - "macos-aarch64": { "regex": "^codex-tui-aarch64-apple-darwin$", "path": "codex-tui" }, - "macos-x86_64": { "regex": "^codex-tui-x86_64-apple-darwin$", "path": "codex-tui" }, - "linux-x86_64": { "regex": "^codex-tui-x86_64-unknown-linux-musl$", "path": "codex-tui" }, - "linux-aarch64": { "regex": "^codex-tui-aarch64-unknown-linux-gnu$", "path": "codex-tui" } - } + "outputs": { + "codex-repl": { + "platforms": { + "macos-aarch64": { "regex": "^codex-repl-aarch64-apple-darwin$", "format": null, "path": "codex-repl" }, + "macos-x86_64": { "regex": "^codex-repl-x86_64-apple-darwin$", "format": null, "path": "codex-repl" }, + "linux-x86_64": { "regex": "^codex-repl-x86_64-unknown-linux-musl$", "format": null, "path": "codex-repl" }, + "linux-aarch64": { "regex": "^codex-repl-aarch64-unknown-linux-gnu$", "format": null, "path": "codex-repl" } + } + }, + + "codex-tui": { + "platforms": { + "macos-aarch64": { "regex": "^codex-tui-aarch64-apple-darwin$", "format": null, "path": "codex-tui" }, + "macos-x86_64": { "regex": "^codex-tui-x86_64-apple-darwin$", "format": null, "path": "codex-tui" }, + "linux-x86_64": { "regex": "^codex-tui-x86_64-unknown-linux-musl$", "format": null, "path": "codex-tui" }, + "linux-aarch64": { "regex": "^codex-tui-aarch64-unknown-linux-gnu$", "format": null, "path": "codex-tui" } } } } - \ No newline at end of file +} From 2e2ef868e8b5ae3925ea4f265f2d206f5840bbdc Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 17:07:04 -0700 Subject: [PATCH 38/48] use dotslash v2 action --- .github/workflows/rust-release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index 61110d5a482..9c961d9724c 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -96,10 +96,9 @@ jobs: prerelease: true draft: true - - uses: facebook/dotslash-publish-release@v1 + - uses: facebook/dotslash-publish-release@v2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag: ${{ env.RELEASE_TAG }} config: .github/dotslash-config.json - From 1ab95aa1c1f3373e23963177997968aceeaaac07 Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 17:11:08 -0700 Subject: [PATCH 39/48] compress --- .github/dotslash-config.json | 16 ++++++++-------- .github/workflows/rust-release.yml | 4 +++- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/dotslash-config.json b/.github/dotslash-config.json index bda8cb171dd..702bb73678e 100644 --- a/.github/dotslash-config.json +++ b/.github/dotslash-config.json @@ -2,19 +2,19 @@ "outputs": { "codex-repl": { "platforms": { - "macos-aarch64": { "regex": "^codex-repl-aarch64-apple-darwin$", "format": null, "path": "codex-repl" }, - "macos-x86_64": { "regex": "^codex-repl-x86_64-apple-darwin$", "format": null, "path": "codex-repl" }, - "linux-x86_64": { "regex": "^codex-repl-x86_64-unknown-linux-musl$", "format": null, "path": "codex-repl" }, - "linux-aarch64": { "regex": "^codex-repl-aarch64-unknown-linux-gnu$", "format": null, "path": "codex-repl" } + "macos-aarch64": { "regex": "^codex-repl-aarch64-apple-darwin\\.zst$", "path": "codex-repl" }, + "macos-x86_64": { "regex": "^codex-repl-x86_64-apple-darwin\\.zst$", "path": "codex-repl" }, + "linux-x86_64": { "regex": "^codex-repl-x86_64-unknown-linux-musl\\.zst$", "path": "codex-repl" }, + "linux-aarch64": { "regex": "^codex-repl-aarch64-unknown-linux-gnu\\.zst$", "path": "codex-repl" } } }, "codex-tui": { "platforms": { - "macos-aarch64": { "regex": "^codex-tui-aarch64-apple-darwin$", "format": null, "path": "codex-tui" }, - "macos-x86_64": { "regex": "^codex-tui-x86_64-apple-darwin$", "format": null, "path": "codex-tui" }, - "linux-x86_64": { "regex": "^codex-tui-x86_64-unknown-linux-musl$", "format": null, "path": "codex-tui" }, - "linux-aarch64": { "regex": "^codex-tui-aarch64-unknown-linux-gnu$", "format": null, "path": "codex-tui" } + "macos-aarch64": { "regex": "^codex-tui-aarch64-apple-darwin\\.zst$", "path": "codex-tui" }, + "macos-x86_64": { "regex": "^codex-tui-x86_64-apple-darwin\\.zst$", "path": "codex-tui" }, + "linux-x86_64": { "regex": "^codex-tui-x86_64-unknown-linux-musl\\.zst$", "path": "codex-tui" }, + "linux-aarch64": { "regex": "^codex-tui-aarch64-unknown-linux-gnu\\.zst$", "path": "codex-tui" } } } } diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index 9c961d9724c..0fce086f891 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -64,10 +64,12 @@ jobs: run: | dest="dist/${{ matrix.target }}" mkdir -p "$dest" - shopt -s nullglob + cp target/${{ matrix.target }}/release/codex-repl "$dest/codex-repl-${{ matrix.target }}" cp target/${{ matrix.target }}/release/codex-tui "$dest/codex-tui-${{ matrix.target }}" + zstd -T0 -19 --rm "$dest"/* + - uses: actions/upload-artifact@v4 with: name: ${{ matrix.target }} From f2053302002f610575a40ef0733e290f9597127f Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Fri, 25 Apr 2025 17:23:55 -0700 Subject: [PATCH 40/48] deconflict release tag in testing --- .github/workflows/rust-release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index 0fce086f891..bd5817ced18 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -79,9 +79,8 @@ jobs: needs: build name: release runs-on: ubuntu-24.04 - env: - RELEASE_TAG: ${{ github.ref_name }} + RELEASE_TAG: codex-rs-${{ github.sha }}-${{ github.run_attempt }}-${{ github.ref_name }} steps: - uses: actions/download-artifact@v4 From 4bd0217db422e84ddad9a045e223e5c1bdb0f354 Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Tue, 29 Apr 2025 10:33:30 -0700 Subject: [PATCH 41/48] remove workflow dispatch, add explicit tag guard --- .github/workflows/rust-release.yml | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index bd5817ced18..0b563ab3601 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -4,15 +4,35 @@ on: tags: - "rust-v.*.*.*" - # remove before landing - workflow_dispatch: - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }} cancel-in-progress: true +env: + TAG_REGEX: '^rust-v\.[0-9]+\.[0-9]+\.[0-9]+$' + jobs: + tag-check: + runs-on: ubuntu-latest + steps: + - name: Verify tag format + shell: bash + run: | + set -euo pipefail + echo "::group::Tag validation" + echo "Ref type : ${GITHUB_REF_TYPE}" + echo "Ref name : ${GITHUB_REF_NAME}" + if [[ "${GITHUB_REF_TYPE}" != "tag" ]]; then + echo "❌ Not a tag push"; exit 1 + fi + if [[ ! "${GITHUB_REF_NAME}" =~ ${TAG_REGEX} ]]; then + echo "❌ Tag '${GITHUB_REF_NAME}' does not match ${TAG_REGEX}"; exit 1 + fi + echo "✅ Tag format OK" + echo "::endgroup::" + build: + needs: tag-check name: ${{ matrix.runner }} - ${{ matrix.target }} runs-on: ${{ matrix.runner }} timeout-minutes: 30 From 7ffe534afef94320fc4fc9f743b078d8961ef9fa Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Tue, 29 Apr 2025 10:38:26 -0700 Subject: [PATCH 42/48] enforce cargo toml match --- .github/workflows/rust-release.yml | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index 0b563ab3601..d4d010f050f 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -15,20 +15,30 @@ jobs: tag-check: runs-on: ubuntu-latest steps: - - name: Verify tag format + - uses: actions/checkout@v4 + + - name: Validate tag matches Cargo.toml version shell: bash run: | set -euo pipefail echo "::group::Tag validation" - echo "Ref type : ${GITHUB_REF_TYPE}" - echo "Ref name : ${GITHUB_REF_NAME}" - if [[ "${GITHUB_REF_TYPE}" != "tag" ]]; then - echo "❌ Not a tag push"; exit 1 - fi - if [[ ! "${GITHUB_REF_NAME}" =~ ${TAG_REGEX} ]]; then - echo "❌ Tag '${GITHUB_REF_NAME}' does not match ${TAG_REGEX}"; exit 1 - fi - echo "✅ Tag format OK" + + # 1. Must be a tag and match the regex + [[ "${GITHUB_REF_TYPE}" == "tag" ]] \ + || { echo "❌ Not a tag push"; exit 1; } + [[ "${GITHUB_REF_NAME}" =~ ${TAG_REGEX} ]] \ + || { echo "❌ Tag '${GITHUB_REF_NAME}' != ${TAG_REGEX}"; exit 1; } + + # 2. Extract versions + tag_ver="${GITHUB_REF_NAME#rust-v.}" + cargo_ver="$(grep -m1 '^version' codex-rs/Cargo.toml \ + | sed -E 's/version *= *"([^"]+)".*/\1/')" + + # 3. Compare + [[ "${tag_ver}" == "${cargo_ver}" ]] \ + || { echo "❌ Tag ${tag_ver} ≠ Cargo.toml ${cargo_ver}"; exit 1; } + + echo "✅ Tag and Cargo.toml agree (${tag_ver})" echo "::endgroup::" build: From 3a68777aa3efa8b651259f28fd8aa3a520dcb05e Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Tue, 29 Apr 2025 10:42:02 -0700 Subject: [PATCH 43/48] version in top level Cargo.toml --- codex-rs/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/codex-rs/Cargo.toml b/codex-rs/Cargo.toml index 69c4e8a8a05..fafe43cfb0a 100644 --- a/codex-rs/Cargo.toml +++ b/codex-rs/Cargo.toml @@ -1,4 +1,5 @@ [workspace] +version = "0.1.0" resolver = "2" members = [ "ansi-escape", From 27dc44bb5298b903c8477d7bcbcad937a69b566a Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Tue, 29 Apr 2025 10:43:30 -0700 Subject: [PATCH 44/48] comment on draft/prerelease --- .github/workflows/rust-release.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index d4d010f050f..478080bd61e 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -124,6 +124,9 @@ jobs: with: tag_name: ${{ env.RELEASE_TAG }} files: dist/** + # TODO(ragona): I'm going to leave these as prerelease/draft for now. + # It gives us 1) clarity that these are not yet a stable version, and + # 2) allows a human step to review the release before publishing the draft. prerelease: true draft: true From 0c0887ae9cd75d93b9fece619eebf3d58bd8cbf3 Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Tue, 29 Apr 2025 10:46:57 -0700 Subject: [PATCH 45/48] comment --- .github/workflows/rust-release.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index 478080bd61e..f23cb92db30 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -1,3 +1,11 @@ +# Release workflow for codex-rs. +# To release, follow a workflow like: +# ``` +# git tag -a rust-v0.1.0 -m "Release 0.1.0" +# git push origin rust-v0.1.0 +# ``` + + name: rust-release on: push: From 64e99cc797b935de0406104851cf0467f7c6c820 Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Tue, 29 Apr 2025 10:54:04 -0700 Subject: [PATCH 46/48] prettier --- .github/workflows/rust-release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index f23cb92db30..e5048dee250 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -5,7 +5,6 @@ # git push origin rust-v0.1.0 # ``` - name: rust-release on: push: From 0068c8be7da1267abeace431694cc73cf303eb1f Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Tue, 29 Apr 2025 12:28:28 -0700 Subject: [PATCH 47/48] workspace versioning --- .github/workflows/rust-release.yml | 3 ++- codex-rs/Cargo.toml | 4 +++- codex-rs/cli/Cargo.toml | 2 +- codex-rs/exec/Cargo.toml | 2 +- codex-rs/repl/Cargo.toml | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index e5048dee250..3c0d92c45fc 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -103,7 +103,8 @@ jobs: mkdir -p "$dest" cp target/${{ matrix.target }}/release/codex-repl "$dest/codex-repl-${{ matrix.target }}" - cp target/${{ matrix.target }}/release/codex-tui "$dest/codex-tui-${{ matrix.target }}" + cp target/${{ matrix.target }}/release/codex-exec "$dest/codex-exec-${{ matrix.target }}" + cp target/${{ matrix.target }}/release/codex-cli "$dest/codex-cli-${{ matrix.target }}" zstd -T0 -19 --rm "$dest"/* diff --git a/codex-rs/Cargo.toml b/codex-rs/Cargo.toml index fafe43cfb0a..d25aa9eda6d 100644 --- a/codex-rs/Cargo.toml +++ b/codex-rs/Cargo.toml @@ -1,5 +1,4 @@ [workspace] -version = "0.1.0" resolver = "2" members = [ "ansi-escape", @@ -12,3 +11,6 @@ members = [ "repl", "tui", ] + +[workspace.package] +version = "0.1.0" diff --git a/codex-rs/cli/Cargo.toml b/codex-rs/cli/Cargo.toml index 12dab8c0306..322d3510bf9 100644 --- a/codex-rs/cli/Cargo.toml +++ b/codex-rs/cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "codex-cli" -version = "0.1.0" +version = { workspace = true } edition = "2021" [[bin]] diff --git a/codex-rs/exec/Cargo.toml b/codex-rs/exec/Cargo.toml index f214f900422..26dd93a52aa 100644 --- a/codex-rs/exec/Cargo.toml +++ b/codex-rs/exec/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "codex-exec" -version = "0.1.0" +version = { workspace = true } edition = "2021" [[bin]] diff --git a/codex-rs/repl/Cargo.toml b/codex-rs/repl/Cargo.toml index 24494ea0197..81f8c64ce72 100644 --- a/codex-rs/repl/Cargo.toml +++ b/codex-rs/repl/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "codex-repl" -version = "0.1.0" +version = { workspace = true } edition = "2021" [[bin]] From 54ec98292120e3cea2576691e91766201905757a Mon Sep 17 00:00:00 2001 From: Ryan Ragona Date: Tue, 29 Apr 2025 15:13:16 -0700 Subject: [PATCH 48/48] lto fat, update included bins --- .github/dotslash-config.json | 19 ++++++++++++++----- codex-rs/Cargo.toml | 3 +++ 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/dotslash-config.json b/.github/dotslash-config.json index 702bb73678e..5803e0a0df0 100644 --- a/.github/dotslash-config.json +++ b/.github/dotslash-config.json @@ -9,12 +9,21 @@ } }, - "codex-tui": { + "codex-exec": { "platforms": { - "macos-aarch64": { "regex": "^codex-tui-aarch64-apple-darwin\\.zst$", "path": "codex-tui" }, - "macos-x86_64": { "regex": "^codex-tui-x86_64-apple-darwin\\.zst$", "path": "codex-tui" }, - "linux-x86_64": { "regex": "^codex-tui-x86_64-unknown-linux-musl\\.zst$", "path": "codex-tui" }, - "linux-aarch64": { "regex": "^codex-tui-aarch64-unknown-linux-gnu\\.zst$", "path": "codex-tui" } + "macos-aarch64": { "regex": "^codex-exec-aarch64-apple-darwin\\.zst$", "path": "codex-exec" }, + "macos-x86_64": { "regex": "^codex-exec-x86_64-apple-darwin\\.zst$", "path": "codex-exec" }, + "linux-x86_64": { "regex": "^codex-exec-x86_64-unknown-linux-musl\\.zst$", "path": "codex-exec" }, + "linux-aarch64": { "regex": "^codex-exec-aarch64-unknown-linux-gnu\\.zst$", "path": "codex-exec" } + } + }, + + "codex-cli": { + "platforms": { + "macos-aarch64": { "regex": "^codex-cli-aarch64-apple-darwin\\.zst$", "path": "codex-cli" }, + "macos-x86_64": { "regex": "^codex-cli-x86_64-apple-darwin\\.zst$", "path": "codex-cli" }, + "linux-x86_64": { "regex": "^codex-cli-x86_64-unknown-linux-musl\\.zst$", "path": "codex-cli" }, + "linux-aarch64": { "regex": "^codex-cli-aarch64-unknown-linux-gnu\\.zst$", "path": "codex-cli" } } } } diff --git a/codex-rs/Cargo.toml b/codex-rs/Cargo.toml index d25aa9eda6d..264a9b3d5ba 100644 --- a/codex-rs/Cargo.toml +++ b/codex-rs/Cargo.toml @@ -14,3 +14,6 @@ members = [ [workspace.package] version = "0.1.0" + +[profile.release] +lto = "fat" \ No newline at end of file