fix(release): tolerate npm registry propagation delay
This commit is contained in:
parent
b7539467a6
commit
726b730b84
|
|
@ -112,7 +112,15 @@ jobs:
|
|||
run: npm run verify:package
|
||||
|
||||
- name: Publish
|
||||
run: npm publish --access public
|
||||
shell: bash
|
||||
run: |
|
||||
version="$(node --input-type=module -e 'import packageJson from "./package.json" with { type: "json" }; process.stdout.write(packageJson.version)')"
|
||||
published_version="$(npm view "rea-agents@${version}" version --json 2>/dev/null || true)"
|
||||
if [ "${published_version}" = "\"${version}\"" ]; then
|
||||
echo "rea-agents@${version} is already published; verifying the existing package."
|
||||
else
|
||||
npm publish --access public
|
||||
fi
|
||||
|
||||
- name: Verify published CLI from npm
|
||||
shell: bash
|
||||
|
|
@ -121,16 +129,20 @@ jobs:
|
|||
verification_root="$(mktemp -d)"
|
||||
trap 'rm -rf -- "${verification_root}"' EXIT
|
||||
cd "${verification_root}"
|
||||
for attempt in 1 2 3 4 5 6; do
|
||||
if npm view "rea-agents@${version}" version --json >/dev/null 2>&1 \
|
||||
&& npm exec --yes --package="rea-agents@${version}" -- rea --help \
|
||||
&& npm exec --yes --package="rea-agents@${version}" -- rea --llms \
|
||||
&& node "${GITHUB_WORKSPACE}/scripts/verify-published-package.mjs" "${version}"; then
|
||||
exit 0
|
||||
for attempt in $(seq 1 20); do
|
||||
published_version="$(npm view "rea-agents@${version}" version --json 2>/dev/null || true)"
|
||||
if [ "${published_version}" = "\"${version}\"" ]; then
|
||||
if npm exec --yes --package="rea-agents@${version}" -- rea --help \
|
||||
&& npm exec --yes --package="rea-agents@${version}" -- rea --llms \
|
||||
&& node "${GITHUB_WORKSPACE}/scripts/verify-published-package.mjs" "${version}"; then
|
||||
exit 0
|
||||
fi
|
||||
echo "Published rea-agents@${version} is visible, but CLI verification failed on attempt ${attempt}" >&2
|
||||
else
|
||||
echo "rea-agents@${version} is not visible on npm yet (attempt ${attempt}/20)" >&2
|
||||
fi
|
||||
if [ "${attempt}" -lt 6 ]; then
|
||||
echo "Published package verification attempt ${attempt} failed; retrying in 10 seconds" >&2
|
||||
sleep 10
|
||||
if [ "${attempt}" -lt 20 ]; then
|
||||
sleep 15
|
||||
fi
|
||||
done
|
||||
echo "Published rea-agents@${version} failed registry and CLI verification" >&2
|
||||
|
|
|
|||
Loading…
Reference in New Issue