Skip to content

Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.

Fix OpenClaw GPR package build

JerrettDavisce405b0a5a4e
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index a08f05f2d..13844d06a 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -281,31 +281,32 @@ jobs:
cp -R sdk/typescript "$workdir/sdk"
cd "$workdir/sdk"
- npm install
- npm run build
- npm version ${{ needs.detect-version.outputs.npm_version }} --no-git-tag-version --allow-same-version
- node <<'EOF'
- const fs = require("fs");
- const pkg = JSON.parse(fs.readFileSync("package.json", "utf8"));
- pkg.name = `@${process.env.GITHUB_PACKAGES_SCOPE}/${pkg.name}`;
+ npm install
+ npm run build
+ npm version ${{ needs.detect-version.outputs.npm_version }} --no-git-tag-version --allow-same-version
+ unscoped_sdk_tarball="$(npm pack --pack-destination "$assets_dir" | tail -n 1)"
+ node <<'EOF'
+ const fs = require("fs");
+ const pkg = JSON.parse(fs.readFileSync("package.json", "utf8"));
+ pkg.name = `@${process.env.GITHUB_PACKAGES_SCOPE}/${pkg.name}`;
pkg.publishConfig = {
...(pkg.publishConfig || {}),
registry: process.env.GITHUB_PACKAGES_REGISTRY_URL,
- };
- fs.writeFileSync("package.json", `${JSON.stringify(pkg, null, 2)}\n`);
- EOF
- sdk_tarball="$(npm pack --pack-destination "$assets_dir" | tail -n 1)"
- npm publish --access public --registry ${{ env.GITHUB_PACKAGES_REGISTRY_URL }}
-
- printf 'sdk_tarball=%s\n' "$assets_dir/$sdk_tarball" >> "$GITHUB_OUTPUT"
+ };
+ fs.writeFileSync("package.json", `${JSON.stringify(pkg, null, 2)}\n`);
+ EOF
+ sdk_tarball="$(npm pack --pack-destination "$assets_dir" | tail -n 1)"
+ printf 'unscoped_sdk_tarball=%s\n' "$assets_dir/$unscoped_sdk_tarball" >> "$GITHUB_OUTPUT"
+ printf 'sdk_tarball=%s\n' "$assets_dir/$sdk_tarball" >> "$GITHUB_OUTPUT"
+ npm publish --access public --registry ${{ env.GITHUB_PACKAGES_REGISTRY_URL }}
continue-on-error: true
- name: Publish ${{ env.NPM_OPENCLAW_PACKAGE }} to GitHub Package Registry
id: gpr-openclaw-publish
env:
- NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- GITHUB_PACKAGES_SCOPE: ${{ steps.gh-scope.outputs.scope }}
- SDK_TARBALL: ${{ steps.gpr-sdk-publish.outputs.sdk_tarball }}
+ NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ GITHUB_PACKAGES_SCOPE: ${{ steps.gh-scope.outputs.scope }}
+ SDK_TARBALL: ${{ steps.gpr-sdk-publish.outputs.unscoped_sdk_tarball }}
run: |
workdir="$(mktemp -d)"
cp -R plugins/openclaw "$workdir/openclaw"
diff --git a/tests/test_release_workflows.py b/tests/test_release_workflows.py
index 729ee0c38..168b70fb1 100644
--- a/tests/test_release_workflows.py
+++ b/tests/test_release_workflows.py
@@ -21,6 +21,10 @@ def test_release_workflow_publishes_both_node_packages_to_github_packages() -> N
assert "Publish ${{ env.NPM_SDK_PACKAGE }} to GitHub Package Registry" in content
assert "Publish ${{ env.NPM_OPENCLAW_PACKAGE }} to GitHub Package Registry" in content
assert "pkg.name = `@${process.env.GITHUB_PACKAGES_SCOPE}/${pkg.name}`;" in content
+ assert (
+ 'unscoped_sdk_tarball="$(npm pack --pack-destination "$assets_dir" | tail -n 1)"' in content
+ )
+ assert "SDK_TARBALL: ${{ steps.gpr-sdk-publish.outputs.unscoped_sdk_tarball }}" in content
def test_create_release_runs_after_successful_build_even_if_other_publishes_fail() -> None: