Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 31 additions & 17 deletions .github/workflows/rust-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1355,19 +1355,15 @@ jobs:
other_tarballs+=("${tarball}")
done

# Publish the platform packages before the root CLI wrapper. The root
# wrapper advances @openai/codex@latest, so it should only publish
# after the optional dependency versions it references exist.
tarballs=(
"${platform_tarballs[@]}"
"${other_tarballs[@]}"
"${root_tarball}"
)
if [[ -f "${sdk_tarball}" ]]; then
tarballs+=("${sdk_tarball}")
fi
publish_tarball() {
local tarball="$1"
local filename
local tag
local platform
local publish_output
local publish_status
local -a publish_cmd

for tarball in "${tarballs[@]}"; do
filename="$(basename "${tarball}")"
tag=""

Expand All @@ -1382,7 +1378,7 @@ jobs:
;;
*)
echo "Unexpected npm tarball: ${filename}"
exit 1
return 1
;;
esac

Expand All @@ -1399,16 +1395,34 @@ jobs:

echo "${publish_output}"
if [[ ${publish_status} -eq 0 ]]; then
continue
return 0
fi

if grep -qiE "previously published|cannot publish over|version already exists" <<< "${publish_output}"; then
echo "Skipping already-published package version for ${filename}"
continue
return 0
fi

exit "${publish_status}"
done
return "${publish_status}"
}

# Publish independent packages concurrently, but wait for all of
# them before publishing the root CLI wrapper.
independent_tarballs=(
"${platform_tarballs[@]}"
"${other_tarballs[@]}"
)

export prefix
export -f publish_tarball
printf '%s\0' "${independent_tarballs[@]}" |
xargs -0 -n1 -P0 bash -c "publish_tarball \"\$1\"" _

publish_tarball "${root_tarball}"
# The SDK depends on this exact root package version.
if [[ -f "${sdk_tarball}" ]]; then
publish_tarball "${sdk_tarball}"
fi

deploy-dev-website:
name: Trigger developers.openai.com deploy
Expand Down
Loading