Skip to content

Commit c720581

Browse files
authored
Merge branch 'main' into add-github-action-for-nix
2 parents d0d6483 + c07fb71 commit c720581

File tree

177 files changed

+5914
-2827
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

177 files changed

+5914
-2827
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Install dependencies
2828
run: pnpm install --frozen-lockfile
2929

30-
# build_npm_package.py requires DotSlash when staging releases.
30+
# stage_npm_packages.py requires DotSlash when staging releases.
3131
- uses: facebook/install-dotslash@v2
3232

3333
- name: Stage npm package
@@ -37,10 +37,12 @@ jobs:
3737
run: |
3838
set -euo pipefail
3939
CODEX_VERSION=0.40.0
40-
PACK_OUTPUT="${RUNNER_TEMP}/codex-npm.tgz"
41-
python3 ./codex-cli/scripts/build_npm_package.py \
40+
OUTPUT_DIR="${RUNNER_TEMP}"
41+
python3 ./scripts/stage_npm_packages.py \
4242
--release-version "$CODEX_VERSION" \
43-
--pack-output "$PACK_OUTPUT"
43+
--package codex \
44+
--output-dir "$OUTPUT_DIR"
45+
PACK_OUTPUT="${OUTPUT_DIR}/codex-npm-${CODEX_VERSION}.tgz"
4446
echo "pack_output=$PACK_OUTPUT" >> "$GITHUB_OUTPUT"
4547
4648
- name: Upload staged npm package artifact

.github/workflows/rust-release.yml

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -216,31 +216,30 @@ jobs:
216216
echo "npm_tag=" >> "$GITHUB_OUTPUT"
217217
fi
218218
219-
# build_npm_package.py requires DotSlash when staging releases.
219+
- name: Setup pnpm
220+
uses: pnpm/action-setup@v4
221+
with:
222+
run_install: false
223+
224+
- name: Setup Node.js for npm packaging
225+
uses: actions/setup-node@v5
226+
with:
227+
node-version: 22
228+
229+
- name: Install dependencies
230+
run: pnpm install --frozen-lockfile
231+
232+
# stage_npm_packages.py requires DotSlash when staging releases.
220233
- uses: facebook/install-dotslash@v2
221-
- name: Stage codex CLI npm package
234+
- name: Stage npm packages
222235
env:
223236
GH_TOKEN: ${{ github.token }}
224237
run: |
225-
set -euo pipefail
226-
TMP_DIR="${RUNNER_TEMP}/npm-stage"
227-
./codex-cli/scripts/build_npm_package.py \
228-
--package codex \
238+
./scripts/stage_npm_packages.py \
229239
--release-version "${{ steps.release_name.outputs.name }}" \
230-
--staging-dir "${TMP_DIR}" \
231-
--pack-output "${GITHUB_WORKSPACE}/dist/npm/codex-npm-${{ steps.release_name.outputs.name }}.tgz"
232-
233-
- name: Stage responses API proxy npm package
234-
env:
235-
GH_TOKEN: ${{ github.token }}
236-
run: |
237-
set -euo pipefail
238-
TMP_DIR="${RUNNER_TEMP}/npm-stage-responses"
239-
./codex-cli/scripts/build_npm_package.py \
240+
--package codex \
240241
--package codex-responses-api-proxy \
241-
--release-version "${{ steps.release_name.outputs.name }}" \
242-
--staging-dir "${TMP_DIR}" \
243-
--pack-output "${GITHUB_WORKSPACE}/dist/npm/codex-responses-api-proxy-npm-${{ steps.release_name.outputs.name }}.tgz"
242+
--package codex-sdk
244243
245244
- name: Create GitHub Release
246245
uses: softprops/action-gh-release@v2
@@ -300,6 +299,10 @@ jobs:
300299
--repo "${GITHUB_REPOSITORY}" \
301300
--pattern "codex-responses-api-proxy-npm-${version}.tgz" \
302301
--dir dist/npm
302+
gh release download "$tag" \
303+
--repo "${GITHUB_REPOSITORY}" \
304+
--pattern "codex-sdk-npm-${version}.tgz" \
305+
--dir dist/npm
303306
304307
# No NODE_AUTH_TOKEN needed because we use OIDC.
305308
- name: Publish to npm
@@ -316,6 +319,7 @@ jobs:
316319
tarballs=(
317320
"codex-npm-${VERSION}.tgz"
318321
"codex-responses-api-proxy-npm-${VERSION}.tgz"
322+
"codex-sdk-npm-${VERSION}.tgz"
319323
)
320324
321325
for tarball in "${tarballs[@]}"; do

codex-cli/scripts/README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
# npm releases
22

3-
Run the following:
4-
5-
To build the 0.2.x or later version of the npm module, which runs the Rust version of the CLI, build it as follows:
3+
Use the staging helper in the repo root to generate npm tarballs for a release. For
4+
example, to stage the CLI, responses proxy, and SDK packages for version `0.6.0`:
65

76
```bash
8-
./codex-cli/scripts/build_npm_package.py --release-version 0.6.0
7+
./scripts/stage_npm_packages.py \
8+
--release-version 0.6.0 \
9+
--package codex \
10+
--package codex-responses-api-proxy \
11+
--package codex-sdk
912
```
1013

11-
Note this will create `./codex-cli/vendor/` as a side-effect.
14+
This downloads the native artifacts once, hydrates `vendor/` for each package, and writes
15+
tarballs to `dist/npm/`.
16+
17+
If you need to invoke `build_npm_package.py` directly, run
18+
`codex-cli/scripts/install_native_deps.py` first and pass `--vendor-src` pointing to the
19+
directory that contains the populated `vendor/` tree.

0 commit comments

Comments
 (0)