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
51 changes: 30 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,29 @@ on:
branches: [main]

jobs:
build-extension:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm ci
working-directory: apps/extension
- name: Compile extension
run: npm run compile
working-directory: apps/extension
- name: Package VSIX
run: npx @vscode/vsce package --no-dependencies --skip-license --no-git-tag-version --allow-missing-repository
working-directory: apps/extension
- uses: actions/upload-artifact@v4
with:
name: openclaw-extension
path: apps/extension/*.vsix

build-wrapper:
needs: build-extension
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
Expand All @@ -17,6 +39,14 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Download extension VSIX
uses: actions/download-artifact@v4
with:
name: openclaw-extension
path: apps/wrapper/extensions
- name: Verify VSIX bundled
shell: bash
run: ls -la apps/wrapper/extensions/*.vsix
- name: Install dependencies
run: npm ci
working-directory: apps/wrapper
Expand All @@ -29,24 +59,3 @@ jobs:
with:
name: occode-${{ matrix.os }}
path: apps/wrapper/dist/*

build-extension:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm ci
working-directory: apps/extension
- name: Compile extension
run: npm run compile
working-directory: apps/extension
- name: Package VSIX
run: npx @vscode/vsce package --no-dependencies --skip-license --no-git-tag-version --allow-missing-repository
working-directory: apps/extension
- uses: actions/upload-artifact@v4
with:
name: openclaw-extension
path: apps/extension/*.vsix
9 changes: 9 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
path: apps/extension/*.vsix

build-wrapper:
needs: build-extension
strategy:
matrix:
include:
Expand All @@ -46,6 +47,14 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Download extension VSIX
uses: actions/download-artifact@v4
with:
name: extension-vsix
path: apps/wrapper/extensions
- name: Verify VSIX bundled
shell: bash
run: ls -la apps/wrapper/extensions/*.vsix
- name: Install dependencies
run: npm ci
working-directory: apps/wrapper
Expand Down
20 changes: 10 additions & 10 deletions apps/wrapper/src/setup.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
const fs = require('fs');
const path = require('path');
const { execFile, spawn } = require('child_process');
const { promisify } = require('util');

const execFileAsync = promisify(execFile);
const { execSync, spawn } = require('child_process');

const DEFAULT_SETTINGS = {
"workbench.startupEditor": "none",
Expand All @@ -20,20 +17,23 @@ async function installExtension(codiumBinary, occodeDir) {
path.join(process.resourcesPath || '', 'extensions'),
];

console.log('[OCcode] Looking for extensions in:', searchPaths);

for (const dir of searchPaths) {
if (!fs.existsSync(dir)) continue;
const vsixFiles = fs.readdirSync(dir).filter(f => f.endsWith('.vsix'));
console.log('[OCcode] Found VSIX in', dir, ':', vsixFiles);
for (const vsix of vsixFiles) {
const vsixPath = path.join(dir, vsix);
const userDataDir = path.join(occodeDir, 'user-data');
try {
await execFileAsync(codiumBinary, [
'--install-extension', vsixPath,
'--user-data-dir', userDataDir,
'--force',
], { timeout: 60000 });
// Use execSync with shell:true — codium binary is a shell script on Linux/Mac
const cmd = `"${codiumBinary}" --install-extension "${vsixPath}" --user-data-dir "${userDataDir}" --force`;
console.log('[OCcode] Running:', cmd);
const output = execSync(cmd, { timeout: 120000, shell: true, encoding: 'utf8' });
console.log('[OCcode] Install result:', output.trim());
} catch (err) {
console.warn(`Failed to install ${vsix}:`, err.message);
console.warn(`[OCcode] Failed to install ${vsix}:`, err.message);
}
}
}
Expand Down