Skip to content

Commit bd5a9e8

Browse files
authored
chore: update release scripts for the TypeScript CLI (#1472)
This introduces two changes to make a quick fix so we can deploy the Rust CLI for `0.2.0` of `@openai/codex` on npm: - Updates `WORKFLOW_URL` to point to https://github.com/openai/codex/actions/runs/15981617627, which is the GitHub workflow run used to create the binaries for the `0.2.0` release we published to Homebrew. - Adds a `--version` option to `stage_release.sh` to specify what the `version` field in the `package.json` will be. Locally, I ran the following: ``` ./codex-cli/scripts/stage_release.sh --native --version 0.2.0 ``` Previously, we only used the `--native` flag to publish to the `native` tag of `@openai/codex` (e.g., `npm publish --tag native`), but we should just publish this as the default tag for `0.2.0` to be consistent with what is in Homebrew. We can still publish one "final" version of the TypeScript CLI as 0.1.x later. Under the hood, this release will still contain `dist/cli.js`, `bin/codex-linux-sandbox-x64`, and `bin/codex-x86_64-apple-darwin`, which are not strictly necessary, but we'll fix that in `0.3.0`.
1 parent abcca30 commit bd5a9e8

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

codex-cli/scripts/install_native_deps.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ mkdir -p "$BIN_DIR"
6565
# Until we start publishing stable GitHub releases, we have to grab the binaries
6666
# from the GitHub Action that created them. Update the URL below to point to the
6767
# appropriate workflow run:
68-
WORKFLOW_URL="https://github.com/openai/codex/actions/runs/15483730027"
68+
WORKFLOW_URL="https://github.com/openai/codex/actions/runs/15981617627"
6969
WORKFLOW_ID="${WORKFLOW_URL##*/}"
7070

7171
ARTIFACTS_DIR="$(mktemp -d)"

codex-cli/scripts/stage_release.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,12 @@ set -euo pipefail
3030

3131
usage() {
3232
cat <<EOF
33-
Usage: $(basename "$0") [--tmp DIR] [--native]
33+
Usage: $(basename "$0") [--tmp DIR] [--native] [--version VERSION]
3434
3535
Options
3636
--tmp DIR Use DIR to stage the release (defaults to a fresh mktemp dir)
3737
--native Bundle Rust binaries for Linux (fat package)
38+
--version Specify the version to release (defaults to a timestamp-based version)
3839
-h, --help Show this help
3940
4041
Legacy positional argument: the first non-flag argument is still interpreted
@@ -45,6 +46,8 @@ EOF
4546

4647
TMPDIR=""
4748
INCLUDE_NATIVE=0
49+
# Default to a timestamp-based version (keep same scheme as before)
50+
VERSION="$(printf '0.1.%d' "$(date +%y%m%d%H%M)")"
4851

4952
# Manual flag parser - Bash getopts does not handle GNU long options well.
5053
while [[ $# -gt 0 ]]; do
@@ -59,6 +62,10 @@ while [[ $# -gt 0 ]]; do
5962
--native)
6063
INCLUDE_NATIVE=1
6164
;;
65+
--version)
66+
shift || { echo "--version requires an argument"; usage 1; }
67+
VERSION="$1"
68+
;;
6269
-h|--help)
6370
usage 0
6471
;;
@@ -108,9 +115,6 @@ cp -r dist "$TMPDIR/dist"
108115
cp -r src "$TMPDIR/src" # keep source for TS sourcemaps
109116
cp ../README.md "$TMPDIR" || true # README is one level up - ignore if missing
110117

111-
# Derive a timestamp-based version (keep same scheme as before)
112-
VERSION="$(printf '0.1.%d' "$(date +%y%m%d%H%M)")"
113-
114118
# Modify package.json - bump version and optionally add the native directory to
115119
# the files array so that the binaries are published to npm.
116120

0 commit comments

Comments
 (0)