-
Notifications
You must be signed in to change notification settings - Fork 321
96 lines (82 loc) · 3.5 KB
/
Copy pathstdio-bridge-release.yml
File metadata and controls
96 lines (82 loc) · 3.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Build, smoke-test, and (on a tag) publish the thunderbolt-stdio-bridge CLI.
#
# On every push/PR touching thunderbolt-stdio-bridge/** we bundle bridge.cjs and
# prove all three entry points work: --help exits 0, the ACP face prints its
# `listening` banner, the MCP face prints its `mcp-listening` banner. On a
# `stdio-bridge-v*` tag we additionally attach bridge.cjs to the tag's GitHub
# Release, which install.sh fetches via releases/download/stdio-bridge-v<v>/.
name: stdio-bridge release
on:
push:
branches: [main]
paths: ['thunderbolt-stdio-bridge/**']
tags: ['stdio-bridge-v*']
pull_request:
paths: ['thunderbolt-stdio-bridge/**']
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
defaults:
run:
working-directory: thunderbolt-stdio-bridge
jobs:
build:
name: Build & smoke-test bridge.cjs
runs-on: ubuntu-24.04
# The tag job needs write to publish the release; everything else stays read.
permissions:
contents: ${{ startsWith(github.ref, 'refs/tags/stdio-bridge-v') && 'write' || 'read' }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: '22'
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
with:
bun-version: 1.3.14
- run: bun install --frozen-lockfile
- run: bun run build
# bridge.cjs parses and --help exits 0 (no child, no framing at risk).
- name: Smoke --help
run: |
node dist/bridge.cjs --help | grep -q "thunderbolt-stdio-bridge"
node dist/bridge.cjs --version
# ACP face: bind the WS face over a trivial `cat` child and confirm the
# readiness banner reaches stderr (token: `listening`). Capture stderr to a
# file, poll until the banner lands, then kill the still-running bridge.
- name: Smoke ACP (listening)
run: |
node dist/bridge.cjs --mode acp --json -- cat 2>acp.log &
pid=$!
for _ in $(seq 1 50); do
grep -q '"event":"listening"' acp.log && break
sleep 0.2
done
kill "$pid" 2>/dev/null || true
grep -q '"event":"listening"' acp.log
grep -q 'ws://127.0.0.1:' acp.log
# MCP face: bridge the bundled server-everything stdio server and confirm
# the readiness banner reaches stderr (token: `mcp-listening`).
- name: Smoke MCP (mcp-listening)
run: |
node dist/bridge.cjs --mode mcp --json -- \
node node_modules/@modelcontextprotocol/server-everything/dist/index.js stdio 2>mcp.log &
pid=$!
for _ in $(seq 1 50); do
grep -q '"event":"mcp-listening"' mcp.log && break
sleep 0.2
done
kill "$pid" 2>/dev/null || true
grep -q '"event":"mcp-listening"' mcp.log
grep -q 'http://127.0.0.1:' mcp.log
- name: Publish bridge.cjs to the tag's GitHub Release
if: startsWith(github.ref, 'refs/tags/stdio-bridge-v')
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create "${GITHUB_REF_NAME}" dist/bridge.cjs --title "${GITHUB_REF_NAME}" --generate-notes