Files
codex/.github/actions/build-bazel-release/action.yml
T
iceweasel-oai 80ea5901ad Bundle the Statsig client key in release builds (#64016)
## Why

Codex needs a non-empty client key at compile time to use Statsig gates
when the feature is enabled.

## What changed

Set `CODEX_BUNDLED_STATSIG_CLIENT_KEY` from the `CODEX_STATSIG_CLIENT_KEY`
GitHub Actions variable in the Cargo and Bazel build steps of both release
workflows. The shared Bazel action forwards the key to Rust compilation
when the value is non-empty.

GitOrigin-RevId: 90ad3471417bc030acf90836d3fd0c24d35feffe
2026-11-25 22:56:34 +00:00

53 lines
2.1 KiB
YAML

name: Build Bazel release staging archive
description: Build a binary/symbol archive and extract writable inputs for existing signing and packaging.
inputs:
target:
description: Rust release target triple.
required: true
bundle:
description: Binary bundle (combined, primary, app-server, or helpers).
default: combined
release-dir:
description: Directory where the archive is extracted for signing and packaging.
required: true
build-mode:
description: Release optimizations, or debug for faster package smoke builds.
default: release
runs:
using: composite
steps:
- name: Refresh release workspace metadata
shell: bash
working-directory: ${{ github.workspace }}/codex-rs
# Release tags change Cargo.toml; rules_rs needs matching workspace lock entries.
run: cargo update --workspace
- name: Build staging archive
shell: bash
working-directory: ${{ github.workspace }}
env:
TARGET: ${{ inputs.target }}
BUNDLE: ${{ inputs.bundle }}
BUILD_MODE: ${{ inputs.build-mode }}
# Keep Git Bash from rewriting Bazel labels as Windows paths.
MSYS2_ARG_CONV_EXCL: "*"
run: |
./.github/scripts/run-bazel-ci.sh \
${{ runner.os == 'Windows' && '--windows-msvc-host-platform' || '' }} -- build \
${{ runner.os == 'macOS' && '--config=ci-macos --remote_download_toplevel' || '' }} \
"--platforms=@rules_rs//rs/platforms:$TARGET" \
${CODEX_BUNDLED_STATSIG_CLIENT_KEY:+"--@rules_rust//rust/settings:extra_rustc_env=CODEX_BUNDLED_STATSIG_CLIENT_KEY=$CODEX_BUNDLED_STATSIG_CLIENT_KEY"} \
"--//codex-rs:runtime_package_build_mode=$BUILD_MODE" \
-- "//codex-rs:runtime_package_$BUNDLE"
- name: Extract staging archive
shell: bash
working-directory: ${{ github.workspace }}
env:
BUNDLE: ${{ inputs.bundle }}
RELEASE_DIR: ${{ inputs.release-dir }}
run: |
mkdir -p "$RELEASE_DIR"
tar -xzf "bazel-bin/codex-rs/runtime_package_$BUNDLE.tar.gz" -C "$RELEASE_DIR"