| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Three pieces, intended to land together so a tag push produces a complete
matrix of release assets and the install one-liner becomes self-serve:
1. .github/workflows/release.yml — on `v*` tag push (or workflow_dispatch),
runs build.ts on a Linux runner, Bun cross-compiles every target
(linux x64/arm64 [+baseline +musl], darwin x64/arm64 [+baseline],
windows x64/arm64 [+baseline]), and uploads archives to the matching
GitHub Release. Creates the release as prerelease if it doesn't exist
yet so reruns work via --clobber.
2. packages/opencode/script/build.ts — split the dist subdir name (npm
package id, `@browser-use/browsercode-core-<target>`) from the
release-asset basename (`bcode-<target>`). Archives now write to
`dist/bcode-<target>.{tar.gz,zip}` and the upload glob is
`./dist/bcode-*`. Required so the install script can construct
stable, slash-free asset URLs. Yellow-zone — documented in
memory/browsercode/EXCEPTIONS.md.
3. install.sh — port of opencode's installer. Diffs vs upstream:
APP=bcode, INSTALL_DIR=$HOME/.bcode/bin, repo URL is
browser-use/browsercode, shell-rc marker is `# bcode`, BrowserCode
wordmark + footer text. Adds a uv-on-PATH check that prints a
one-line install hint when missing (the harness needs uv at runtime
for browser_execute) — never auto-installs.
Verified locally: build.ts `--single` for linux-x64 still produces the
correct binary; archive cwd math (`../../../` from
`dist/<scope>/<pkg>-<target>/bin/`) lands archives at
`dist/bcode-<target>.tar.gz`. Typecheck passes. install.sh syntax-clean
under `bash -n`.
Pre-conditions for the install one-liner to work end-to-end (post-merge):
- Repo made public (or install script switches to a private-fetch path).
- DNS for bcode.sh CNAME'd to a static host serving install.sh.
- A v0.0.3 tag pushed to trigger the new workflow.
There was a problem hiding this comment.
2 issues found across 3 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/opencode/script/build.ts">
<violation number="1" location="packages/opencode/script/build.ts:272">
P1: Archive output path is incorrect (`../../../`), so release artifacts are written outside `dist` and the upload glob misses them.</violation>
</file>
<file name=".github/workflows/release.yml">
<violation number="1" location=".github/workflows/release.yml:48">
P1: Manual dispatch builds are not pinned to the requested tag, so artifacts can be uploaded to a release tag from the wrong commit.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.
Sorry, something went wrong.
| await $`tar -czf ../../../${info.assetName}.tar.gz *`.cwd(`dist/${key}/bin`) | ||
| } else { | ||
| await $`zip -r ../../${key}.zip *`.cwd(`dist/${key}/bin`) | ||
| await $`zip -r ../../../${info.assetName}.zip *`.cwd(`dist/${key}/bin`) |
There was a problem hiding this comment.
P1: Archive output path is incorrect (../../../), so release artifacts are written outside dist and the upload glob misses them.
Prompt for AI agentsCheck if this issue is valid — if so, understand the root cause and fix it. At packages/opencode/script/build.ts, line 272:
<comment>Archive output path is incorrect (`../../../`), so release artifacts are written outside `dist` and the upload glob misses them.</comment>
<file context>
@@ -259,18 +262,19 @@ for (const item of targets) {
+ // archive at dist/<assetName>.{tar.gz,zip} so `gh release upload ./dist/bcode-*` finds clean basenames.
if (key.includes("linux")) {
- await $`tar -czf ../../${key}.tar.gz *`.cwd(`dist/${key}/bin`)
+ await $`tar -czf ../../../${info.assetName}.tar.gz *`.cwd(`dist/${key}/bin`)
} else {
- await $`zip -r ../../${key}.zip *`.cwd(`dist/${key}/bin`)
</file context>
| await $`tar -czf ../../../${info.assetName}.tar.gz *`.cwd(`dist/${key}/bin`) | |
| } else { | |
| await $`zip -r ../../${key}.zip *`.cwd(`dist/${key}/bin`) | |
| await $`zip -r ../../../${info.assetName}.zip *`.cwd(`dist/${key}/bin`) | |
| await $`tar -czf ../../${info.assetName}.tar.gz *`.cwd(`dist/${key}/bin`) | |
| } else { | |
| await $`zip -r ../../${info.assetName}.zip *`.cwd(`dist/${key}/bin`) |
Sorry, something went wrong.
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 |
There was a problem hiding this comment.
P1: Manual dispatch builds are not pinned to the requested tag, so artifacts can be uploaded to a release tag from the wrong commit.
Prompt for AI agentsCheck if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/release.yml, line 48:
<comment>Manual dispatch builds are not pinned to the requested tag, so artifacts can be uploaded to a release tag from the wrong commit.</comment>
<file context>
@@ -0,0 +1,101 @@
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+
+ - name: Resolve tag + version
</file context>
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Two of the three pieces needed for curl -fsSL https://bcode.sh/install | bash. The third (the release-build workflow file) needs the user to add it directly because the BROWSERCODE_DEV_PAT lacks workflow scope — full content is staged at memory/browsercode/release_workflow.yml in the agent home, and the PR description below quotes it inline.
What's in this PR
1. packages/opencode/script/build.ts — split asset name from package name (Yellow zone)
The npm package id remains @browser-use/browsercode-core-<target> (drives the dist/<scope>/<pkg>/ subdir + target: name.replace(pkg.name, "bun") cross-compile target). The release-archive basename is now a separate bcode-<target> value, used only for the tar/zip output filename and the gh release upload glob.
Before: archives landed at dist/@browser-use/browsercode-core-<target>.{tar.gz,zip}. The gh release upload shell glob ./dist/*.tar.gz expanded via the slash to upload them under their basename, working but messy and producing asset URLs with awkward path components for the install script to construct.
After: archives at dist/bcode-<target>.{tar.gz,zip}, uploaded via ./dist/bcode-*.tar.gz ./dist/bcode-*.zip. The install script can now construct stable URLs like https://github.com/browser-use/browsercode/releases/download/v0.0.3/bcode-darwin-arm64.zip.
Documented in memory/browsercode/EXCEPTIONS.md (Phase C1 row, "Maybe" upstream-able).
2. install.sh at repo root — one-line installer (port of opencode.ai/install)
To be served at https://bcode.sh/install. Diffs vs upstream:
Same arch/musl/baseline/rosetta detection as upstream. Same per-shell config-file walking + # bcode markered append. Same --version, --binary, --no-modify-path flag set.
What needs to be added separately (workflow file)
.github/workflows/release.yml was rejected by the push because the PAT lacks workflow scope. Two options:
Option A (preferred): the admin commits the file directly via the GitHub web UI or with a personal token that has workflow scope. The full file is in memory/browsercode/release_workflow.yml on the agent's home repo. The shape:
Option B: rotate the PAT scope on the secret used by this agent (BROWSERCODE_DEV_PAT in the Sprite .env) to include workflow, and ask the agent to submit a follow-up PR with just the workflow file.
Pre-conditions for the install one-liner to actually work post-merge
Verification
Out of scope