-
Notifications
You must be signed in to change notification settings - Fork 12.5k
ci: build Codex package archives in release workflow #23582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
+157
−0
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| usage() { | ||
| cat <<'EOF' | ||
| Usage: build-codex-package-archive.sh \ | ||
| --target <rust-target> \ | ||
| --bundle <primary|app-server> \ | ||
| --entrypoint-dir <dir> \ | ||
| --archive-dir <dir> \ | ||
| [--target-suffixed-entrypoint] | ||
| EOF | ||
| } | ||
|
|
||
| target="" | ||
| bundle="" | ||
| entrypoint_dir="" | ||
| archive_dir="" | ||
| target_suffixed_entrypoint="false" | ||
|
|
||
| while [[ $# -gt 0 ]]; do | ||
| case "$1" in | ||
| --target) | ||
| target="${2:?--target requires a value}" | ||
| shift 2 | ||
| ;; | ||
| --bundle) | ||
| bundle="${2:?--bundle requires a value}" | ||
| shift 2 | ||
| ;; | ||
| --entrypoint-dir) | ||
| entrypoint_dir="${2:?--entrypoint-dir requires a value}" | ||
| shift 2 | ||
| ;; | ||
| --archive-dir) | ||
| archive_dir="${2:?--archive-dir requires a value}" | ||
| shift 2 | ||
| ;; | ||
| --target-suffixed-entrypoint) | ||
| target_suffixed_entrypoint="true" | ||
| shift | ||
| ;; | ||
| -h|--help) | ||
| usage | ||
| exit 0 | ||
| ;; | ||
| *) | ||
| echo "Unexpected argument: $1" >&2 | ||
| usage >&2 | ||
| exit 1 | ||
| ;; | ||
| esac | ||
| done | ||
|
|
||
| if [[ -z "$target" || -z "$bundle" || -z "$entrypoint_dir" || -z "$archive_dir" ]]; then | ||
| usage >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| case "$bundle" in | ||
| primary) | ||
| variant="codex" | ||
| entrypoint="codex" | ||
| archive_stem="codex-package" | ||
| ;; | ||
| app-server) | ||
| variant="codex-app-server" | ||
| entrypoint="codex-app-server" | ||
| archive_stem="codex-app-server-package" | ||
| ;; | ||
| *) | ||
| echo "No Codex package variant for bundle: $bundle" >&2 | ||
| exit 1 | ||
| ;; | ||
| esac | ||
|
|
||
| exe_suffix="" | ||
| case "$target" in | ||
| *windows*) | ||
| exe_suffix=".exe" | ||
| ;; | ||
| esac | ||
|
|
||
| entrypoint_name="$entrypoint" | ||
| if [[ "$target_suffixed_entrypoint" == "true" ]]; then | ||
| entrypoint_name="${entrypoint_name}-${target}" | ||
| fi | ||
|
|
||
| repo_root="${GITHUB_WORKSPACE:-}" | ||
| if [[ -z "$repo_root" ]]; then | ||
| repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" | ||
| fi | ||
|
|
||
| if command -v python3 >/dev/null 2>&1; then | ||
| python_bin="python3" | ||
| else | ||
| python_bin="python" | ||
| fi | ||
|
|
||
| mkdir -p "$archive_dir" | ||
| package_dir="${RUNNER_TEMP:-/tmp}/${archive_stem}-${target}" | ||
| archive_path="${archive_dir}/${archive_stem}-${target}.tar.gz" | ||
| rm -rf "$package_dir" | ||
|
|
||
| "$python_bin" "${repo_root}/scripts/build_codex_package.py" \ | ||
| --target "$target" \ | ||
| --variant "$variant" \ | ||
| --entrypoint-bin "${entrypoint_dir%/}/${entrypoint_name}${exe_suffix}" \ | ||
| --cargo-profile release \ | ||
| --package-dir "$package_dir" \ | ||
| --archive-output "$archive_path" \ | ||
| --force |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P2] This sidecar builder only runs in the main
buildjob.promote_signedskips that job and usesstage-signed-macos, while Windows release artifacts are produced throughrust-release-windows.yml, so those release paths never emit the package archives this PR is introducing. That leaves the workflow artifacts inconsistent across release modes/targets even though the PR is setting up package archives for future consumers. Could we mirror this archive step in the signed-promotion macOS path and the Windows release workflow, or factor the packaging invocation into a shared helper that all three paths call before artifact upload?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in the latest push. I factored the package-archive invocation into
.github/scripts/build-codex-package-archive.sh, then wired it into all three release paths: the existing Linux/macOS build matrix,stage-signed-macosforpromote_signed, andrust-release-windows.ymlafter Windows signing/staging. The signed macOS path packages from the target-suffixed signed files indist/<target>, and Windows emits both primary and app-server package archives before artifact upload. Verified with Bash syntax checks, YAML parsing for both workflows, and a local signed-mac-style helper run that producedcodex-package-aarch64-apple-darwin.tar.gz.