Skip to content
Merged
Show file tree
Hide file tree
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
19 changes: 19 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,29 @@ jobs:
- name: Sync version
run: node scripts/set-version.mjs "${{ needs.create-release.outputs.version }}"

# The automation runtime (tron snapshot/analyze/run/mcp/automate) is the
# compiled browser-core, agent-runtime and sdk packages, which
# build-release.sh stages only when it can build them. That takes pnpm and
# the workspace's dev dependencies; without this step the stage is skipped
# with a one-line note and every release ships without `sdk/`.
- name: Install workspace (for the automation runtime)
if: matrix.platform != 'windows'
run: |
corepack enable
corepack prepare pnpm@9.12.0 --activate
pnpm install --frozen-lockfile --filter @tronbrowser/sdk...

- name: Package (linux/macos)
if: matrix.platform != 'windows'
run: bash apps/desktop/scripts/build-release.sh "v${{ needs.create-release.outputs.version }}" ${{ matrix.platform }}

- name: Check the automation runtime is in the archive
if: matrix.platform != 'windows'
run: |
if [ "${{ matrix.platform }}" = linux ]; then list="tar -tzf dist/tronbrowser-linux-x64.tar.gz"; else list="unzip -Z1 dist/tronbrowser-macos.zip"; fi
$list | grep -q 'sdk/automate-bin.js' \
|| { echo "::error::release archive has no sdk/automate-bin.js (automation runtime was not staged)"; exit 1; }

- name: Package (linux deb + rpm + AppImage)
if: matrix.platform == 'linux'
run: |
Expand Down
11 changes: 9 additions & 2 deletions apps/desktop/scripts/build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ stage_automation() { # dest dir
local s="$1"
command -v node >/dev/null 2>&1 && command -v pnpm >/dev/null 2>&1 || {
echo " ! automation runtime skipped (needs node + pnpm)"; return; }
if ( cd "$REPO_ROOT" && pnpm --filter @tronbrowser/browser-core --filter @tronbrowser/agent-runtime --filter @tronbrowser/sdk build >/dev/null 2>&1 ); then
# Keep the build log: a silent skip here shipped releases with no sdk/ for a
# while (nothing installed pnpm on the release runner) and the only trace was
# one line in the job log.
local log="$s/../automation-build.log"
if ( cd "$REPO_ROOT" && pnpm --filter @tronbrowser/browser-core --filter @tronbrowser/agent-runtime --filter @tronbrowser/sdk build >"$log" 2>&1 ); then
rm -f "$log"
rm -rf "$s/automate" "$s/analyze" "$s/sdk"
cp -R "$REPO_ROOT/packages/browser-core/dist" "$s/automate"
printf '{\n "type": "module"\n}\n' > "$s/automate/package.json"
Expand All @@ -52,7 +57,9 @@ stage_automation() { # dest dir
printf '{\n "type": "module"\n}\n' > "$s/sdk/package.json"
echo " + bundled automation + analyze + SDK (tron snapshot/extract/analyze/run)"
else
echo " ! automation runtime skipped (browser-core/agent-runtime/sdk build failed)"
echo " ! automation runtime skipped (browser-core/agent-runtime/sdk build failed):"
tail -n 20 "$log" 2>/dev/null | sed 's/^/ /'
rm -f "$log"
fi
}

Expand Down
3 changes: 2 additions & 1 deletion services/api/src/mcp/tron.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ export function tronRelay(deps: TronRelayDeps = {}): TronRelay {
c.json({
ok: true,
name: 'TronBrowser',
mcp: `${new URL(c.req.url).origin}/mcp/tron`,
// Railway terminates TLS, so the origin seen here is http://; report what the caller used.
mcp: `${(c.req.header('x-forwarded-proto') ?? new URL(c.req.url).protocol.replace(':', '')).split(',')[0]}://${new URL(c.req.url).host}/mcp/tron`,
descriptor: DESCRIPTOR_URL,
tools: toolNames,
engines: engines
Expand Down
Loading