build: wire ast-grep MCP into release gates
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -55,7 +55,7 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: bun install --frozen-lockfile
|
run: bun install --frozen-lockfile
|
||||||
env:
|
env:
|
||||||
BUN_INSTALL_ALLOW_SCRIPTS: "@ast-grep/napi"
|
BUN_INSTALL_ALLOW_SCRIPTS: "@ast-grep/cli @ast-grep/napi"
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: bun test
|
run: bun test
|
||||||
@@ -83,7 +83,7 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: bun install --frozen-lockfile
|
run: bun install --frozen-lockfile
|
||||||
env:
|
env:
|
||||||
BUN_INSTALL_ALLOW_SCRIPTS: "@ast-grep/napi"
|
BUN_INSTALL_ALLOW_SCRIPTS: "@ast-grep/cli @ast-grep/napi"
|
||||||
|
|
||||||
- name: Type check
|
- name: Type check
|
||||||
run: bun run typecheck
|
run: bun run typecheck
|
||||||
@@ -118,7 +118,7 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: bun install --frozen-lockfile
|
run: bun install --frozen-lockfile
|
||||||
env:
|
env:
|
||||||
BUN_INSTALL_ALLOW_SCRIPTS: "@ast-grep/napi"
|
BUN_INSTALL_ALLOW_SCRIPTS: "@ast-grep/cli @ast-grep/napi"
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: bun run build
|
run: bun run build
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: bun install --frozen-lockfile
|
run: bun install --frozen-lockfile
|
||||||
env:
|
env:
|
||||||
BUN_INSTALL_ALLOW_SCRIPTS: "@ast-grep/napi"
|
BUN_INSTALL_ALLOW_SCRIPTS: "@ast-grep/cli @ast-grep/napi"
|
||||||
|
|
||||||
- name: Validate release inputs
|
- name: Validate release inputs
|
||||||
id: validate
|
id: validate
|
||||||
@@ -187,6 +187,7 @@ jobs:
|
|||||||
retry_wait_seconds: 10
|
retry_wait_seconds: 10
|
||||||
shell: bash
|
shell: bash
|
||||||
command: |
|
command: |
|
||||||
|
bun run build:ast-grep-mcp
|
||||||
PLATFORM="${{ matrix.platform }}"
|
PLATFORM="${{ matrix.platform }}"
|
||||||
PACKAGE_DIR="packages/oh-my-opencode-${PLATFORM}"
|
PACKAGE_DIR="packages/oh-my-opencode-${PLATFORM}"
|
||||||
case "$PLATFORM" in
|
case "$PLATFORM" in
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: bun install --frozen-lockfile
|
run: bun install --frozen-lockfile
|
||||||
env:
|
env:
|
||||||
BUN_INSTALL_ALLOW_SCRIPTS: "@ast-grep/napi"
|
BUN_INSTALL_ALLOW_SCRIPTS: "@ast-grep/cli @ast-grep/napi"
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: bun test
|
run: bun test
|
||||||
@@ -60,7 +60,7 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: bun install --frozen-lockfile
|
run: bun install --frozen-lockfile
|
||||||
env:
|
env:
|
||||||
BUN_INSTALL_ALLOW_SCRIPTS: "@ast-grep/napi"
|
BUN_INSTALL_ALLOW_SCRIPTS: "@ast-grep/cli @ast-grep/napi"
|
||||||
|
|
||||||
- name: Type check
|
- name: Type check
|
||||||
run: bun run typecheck
|
run: bun run typecheck
|
||||||
@@ -162,7 +162,7 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: bun install --frozen-lockfile
|
run: bun install --frozen-lockfile
|
||||||
env:
|
env:
|
||||||
BUN_INSTALL_ALLOW_SCRIPTS: "@ast-grep/napi"
|
BUN_INSTALL_ALLOW_SCRIPTS: "@ast-grep/cli @ast-grep/napi"
|
||||||
|
|
||||||
- name: Calculate version
|
- name: Calculate version
|
||||||
id: version
|
id: version
|
||||||
@@ -232,11 +232,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build main package
|
- name: Build main package
|
||||||
if: steps.check.outputs.skip != 'true'
|
if: steps.check.outputs.skip != 'true'
|
||||||
run: |
|
run: bun run build
|
||||||
bun build src/index.ts --outdir dist --target bun --format esm --external @ast-grep/napi
|
|
||||||
bun build src/cli/index.ts --outdir dist/cli --target bun --format esm --external @ast-grep/napi
|
|
||||||
bunx tsc --emitDeclarationOnly
|
|
||||||
bun run build:schema
|
|
||||||
|
|
||||||
- name: Strip token auth from .npmrc to force OIDC
|
- name: Strip token auth from .npmrc to force OIDC
|
||||||
if: steps.check.outputs.skip != 'true'
|
if: steps.check.outputs.skip != 'true'
|
||||||
@@ -330,7 +326,7 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: bun install --frozen-lockfile
|
run: bun install --frozen-lockfile
|
||||||
env:
|
env:
|
||||||
BUN_INSTALL_ALLOW_SCRIPTS: "@ast-grep/napi"
|
BUN_INSTALL_ALLOW_SCRIPTS: "@ast-grep/cli @ast-grep/napi"
|
||||||
|
|
||||||
- name: Generate changelog
|
- name: Generate changelog
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: bun install --frozen-lockfile
|
run: bun install --frozen-lockfile
|
||||||
env:
|
env:
|
||||||
BUN_INSTALL_ALLOW_SCRIPTS: "@ast-grep/napi"
|
BUN_INSTALL_ALLOW_SCRIPTS: "@ast-grep/cli @ast-grep/napi"
|
||||||
|
|
||||||
- name: Refresh bundled model capabilities snapshot
|
- name: Refresh bundled model capabilities snapshot
|
||||||
run: bun run build:model-capabilities
|
run: bun run build:model-capabilities
|
||||||
|
|||||||
+4
-3
@@ -28,7 +28,7 @@
|
|||||||
"./schema.json": "./dist/oh-my-opencode.schema.json"
|
"./schema.json": "./dist/oh-my-opencode.schema.json"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "bun build src/index.ts --outdir dist --target bun --format esm --external @ast-grep/napi --external zod && bun run build:node-require-shim && tsc --emitDeclarationOnly && bun build src/cli/index.ts --outdir dist/cli --target bun --format esm --external @ast-grep/napi && bun run build:schema",
|
"build": "bun run build:ast-grep-mcp && bun build src/index.ts --outdir dist --target bun --format esm --external @ast-grep/napi --external zod && bun run build:node-require-shim && tsc --emitDeclarationOnly && bun build src/cli/index.ts --outdir dist/cli --target bun --format esm --external @ast-grep/napi && bun run build:schema",
|
||||||
"build:lsp-tools-mcp": "npm --prefix packages/lsp-tools-mcp ci && npm --prefix packages/lsp-tools-mcp run build",
|
"build:lsp-tools-mcp": "npm --prefix packages/lsp-tools-mcp ci && npm --prefix packages/lsp-tools-mcp run build",
|
||||||
"build:node-require-shim": "bun run script/patch-node-require-shim.ts",
|
"build:node-require-shim": "bun run script/patch-node-require-shim.ts",
|
||||||
"build:all": "bun run build && bun run build:binaries",
|
"build:all": "bun run build && bun run build:binaries",
|
||||||
@@ -38,9 +38,10 @@
|
|||||||
"clean": "rm -rf dist",
|
"clean": "rm -rf dist",
|
||||||
"prepare": "bun run build",
|
"prepare": "bun run build",
|
||||||
"postinstall": "node postinstall.mjs",
|
"postinstall": "node postinstall.mjs",
|
||||||
"prepublishOnly": "bun run clean && bun run build:lsp-tools-mcp && bun run build:ast-grep-mcp && bun run build",
|
"prepublishOnly": "bun run clean && bun run build:lsp-tools-mcp && bun run build",
|
||||||
"test:model-capabilities": "bun test src/shared/model-capability-aliases.test.ts src/shared/model-capability-guardrails.test.ts src/shared/model-capabilities.test.ts src/cli/doctor/checks/model-resolution.test.ts --bail",
|
"test:model-capabilities": "bun test src/shared/model-capability-aliases.test.ts src/shared/model-capability-guardrails.test.ts src/shared/model-capabilities.test.ts src/cli/doctor/checks/model-resolution.test.ts --bail",
|
||||||
"typecheck": "tsgo --noEmit",
|
"typecheck": "tsgo --noEmit && bun run typecheck:packages",
|
||||||
|
"typecheck:packages": "tsgo --noEmit -p packages/rules-core/tsconfig.json && tsgo --noEmit -p packages/ast-grep-mcp/tsconfig.json",
|
||||||
"typecheck:script": "tsgo --noEmit -p script/tsconfig.json",
|
"typecheck:script": "tsgo --noEmit -p script/tsconfig.json",
|
||||||
"test": "bun test",
|
"test": "bun test",
|
||||||
"build:ast-grep-mcp": "bun run --cwd packages/ast-grep-mcp build"
|
"build:ast-grep-mcp": "bun run --cwd packages/ast-grep-mcp build"
|
||||||
|
|||||||
@@ -67,6 +67,8 @@ async function main() {
|
|||||||
console.log(` Entry point: ${ENTRY_POINT}`);
|
console.log(` Entry point: ${ENTRY_POINT}`);
|
||||||
console.log(` Platforms: ${PLATFORMS.length}`);
|
console.log(` Platforms: ${PLATFORMS.length}`);
|
||||||
|
|
||||||
|
await $`bun run build:ast-grep-mcp`;
|
||||||
|
|
||||||
// Verify entry point exists
|
// Verify entry point exists
|
||||||
if (!existsSync(ENTRY_POINT)) {
|
if (!existsSync(ENTRY_POINT)) {
|
||||||
console.error(`\n❌ Entry point not found: ${ENTRY_POINT}`);
|
console.error(`\n❌ Entry point not found: ${ENTRY_POINT}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user