Skip to content

armgit / rea

Public Imported from GitHub
0

Reverse engineer anything with agents, from app behavior down to native binaries.

fix(release): tolerate npm registry propagation delay

morluto726b730b8483
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index e33120f4c..87a44903e 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -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