Skip to content

Commit 891f1f4

Browse files
authored
release: publish standalone zsh artifacts (#30114)
## Why The patched zsh artifacts rarely change, but `.github/workflows/rust-release-zsh.yml` currently runs as part of every Rust release. Rebuilding the same four binaries for each Codex version wastes release capacity and ties an independently versioned runtime dependency to the main release cadence. This establishes the producer side of a build-once flow. The existing Rust release workflow remains unchanged until the first standalone artifact release has been published and the checked-in DotSlash manifests can be updated with its URLs and checksums. ## What changed - Run the zsh release workflow for protected `codex-zsh-vX.Y.Z` tags instead of as a reusable workflow. - Validate the semantic release tag before starting the platform builds. - Publish the four zsh archives to a GitHub prerelease so the release never becomes the repository latest release. - Publish the generated `codex-zsh` DotSlash manifest alongside the archives. - Document how to publish the next artifact version after changing the pinned zsh commit or patch. ## Tag protection An active repository tag ruleset named `codex-zsh-v*.*.*` targets `refs/tags/codex-zsh-v*.*.*`. It restricts tag creation, updates, deletion, and non-fast-forward changes; requires linear history; and limits bypass to the configured repository role. This was verified with: ```shell gh api repos/openai/codex/rulesets/18140982 ``` The response reported `"enforcement":"active"`, the expected tag condition, and the `creation`, `update`, `deletion`, `non_fast_forward`, and `required_linear_history` rules. ## Rollout After this lands, publish the first `codex-zsh-vX.Y.Z` release. A follow-up can then update the checked-in DotSlash manifests and remove the zsh rebuild from `.github/workflows/rust-release.yml`. --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/openai/codex/pull/30114). * #30116 * __->__ #30114
1 parent 703793c commit 891f1f4

3 files changed

Lines changed: 89 additions & 1 deletion

File tree

.github/dotslash-zsh-config.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,25 @@
55
"macos-aarch64": {
66
"name": "codex-zsh-aarch64-apple-darwin.tar.gz",
77
"format": "tar.gz",
8+
"hash": "sha256",
89
"path": "codex-zsh/bin/zsh"
910
},
1011
"macos-x86_64": {
1112
"name": "codex-zsh-x86_64-apple-darwin.tar.gz",
1213
"format": "tar.gz",
14+
"hash": "sha256",
1315
"path": "codex-zsh/bin/zsh"
1416
},
1517
"linux-x86_64": {
1618
"name": "codex-zsh-x86_64-unknown-linux-musl.tar.gz",
1719
"format": "tar.gz",
20+
"hash": "sha256",
1821
"path": "codex-zsh/bin/zsh"
1922
},
2023
"linux-aarch64": {
2124
"name": "codex-zsh-aarch64-unknown-linux-musl.tar.gz",
2225
"format": "tar.gz",
26+
"hash": "sha256",
2327
"path": "codex-zsh/bin/zsh"
2428
}
2529
}

.github/workflows/rust-release-zsh.yml

Lines changed: 80 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,56 @@
11
name: rust-release-zsh
22

33
on:
4-
workflow_call:
4+
push:
5+
tags:
6+
- "codex-zsh-v*.*.*"
57

68
env:
79
ZSH_COMMIT: 77045ef899e53b9598bebc5a41db93a548a40ca6
810
ZSH_PATCH: codex-rs/shell-escalation/patches/zsh-exec-wrapper.patch
911

12+
concurrency:
13+
group: ${{ github.workflow }}::${{ github.ref_name }}
14+
cancel-in-progress: false
15+
1016
jobs:
17+
metadata:
18+
runs-on: ubuntu-latest
19+
outputs:
20+
release_tag: ${{ steps.release_tag.outputs.release_tag }}
21+
22+
steps:
23+
- name: Validate release tag
24+
id: release_tag
25+
env:
26+
RELEASE_TAG: ${{ github.ref_name }}
27+
shell: bash
28+
run: |
29+
set -euo pipefail
30+
31+
if [[ ! "${RELEASE_TAG}" =~ ^codex-zsh-v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
32+
echo "Tag ${RELEASE_TAG} does not match codex-zsh-vX.Y.Z." >&2
33+
exit 1
34+
fi
35+
36+
echo "release_tag=${RELEASE_TAG}" >> "${GITHUB_OUTPUT}"
37+
38+
- name: Ensure release does not exist
39+
env:
40+
GH_TOKEN: ${{ github.token }}
41+
RELEASE_TAG: ${{ steps.release_tag.outputs.release_tag }}
42+
shell: bash
43+
run: |
44+
set -euo pipefail
45+
46+
if gh release view "${RELEASE_TAG}" --repo "${GITHUB_REPOSITORY}" > /dev/null 2>&1; then
47+
echo "Release ${RELEASE_TAG} already exists; publish changed artifacts under a new tag." >&2
48+
exit 1
49+
fi
50+
1151
linux:
1252
name: Build zsh (Linux) - ${{ matrix.variant }} - ${{ matrix.target }}
53+
needs: metadata
1354
runs-on: ${{ matrix.runner }}
1455
timeout-minutes: 30
1556
container:
@@ -62,6 +103,7 @@ jobs:
62103

63104
darwin:
64105
name: Build zsh (macOS) - ${{ matrix.variant }} - ${{ matrix.target }}
106+
needs: metadata
65107
runs-on: ${{ matrix.runner }}
66108
timeout-minutes: 30
67109

@@ -101,3 +143,40 @@ jobs:
101143
with:
102144
name: codex-zsh-${{ matrix.target }}
103145
path: dist/zsh/${{ matrix.target }}/*
146+
147+
publish-release:
148+
needs:
149+
- metadata
150+
- linux
151+
- darwin
152+
runs-on: ubuntu-latest
153+
permissions:
154+
contents: write
155+
actions: read
156+
157+
steps:
158+
- name: Checkout repository
159+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
160+
with:
161+
persist-credentials: false
162+
163+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
164+
with:
165+
path: dist
166+
167+
- name: Create GitHub Release
168+
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1
169+
with:
170+
tag_name: ${{ needs.metadata.outputs.release_tag }}
171+
name: ${{ needs.metadata.outputs.release_tag }}
172+
files: dist/**
173+
# Keep zsh artifact releases out of Codex's normal "latest release" channel.
174+
prerelease: true
175+
176+
- name: Publish DotSlash manifest
177+
uses: facebook/dotslash-publish-release@9c9ec027515c34db9282a09a25a9cab5880b2c52 # v2
178+
env:
179+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
180+
with:
181+
tag: ${{ needs.metadata.outputs.release_tag }}
182+
config: .github/dotslash-zsh-config.json

codex-rs/shell-escalation/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,8 @@ git apply /path/to/patches/zsh-exec-wrapper.patch
2727
./configure
2828
make -j"$(nproc)"
2929
```
30+
31+
Release artifacts are built by `.github/workflows/rust-release-zsh.yml` when a
32+
`codex-zsh-vX.Y.Z` tag is pushed. When the zsh commit or patch changes, publish
33+
the next version tag and update the checked-in DotSlash manifests to use the new
34+
release.

0 commit comments

Comments
 (0)