Repository navigation
75 lines (71 loc) · 2.89 KB
/
Copy pathdocker.yml
File metadata and controls
75 lines (71 loc) · 2.89 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
name: docker
# Publishes the MCP-server image to GHCR on every release tag
# (and on demand for a given tag via workflow_dispatch).
#
# Trigger is the TAG PUSH, not release:published — goreleaser creates
# the release with GITHUB_TOKEN, and GITHUB_TOKEN-caused events never
# start other workflows (verified live on v0.11.2: release event fired
# nothing; the image had to be backfilled by hand).
on:
push:
tags: ["v*"]
workflow_dispatch:
inputs:
tag:
description: "Git tag to build (e.g. v0.11.2)"
required: true
permissions:
contents: read
packages: write
jobs:
publish:
runs-on: ubuntu-latest
env:
IMAGE: ghcr.io/soren-achebe/backscroll
steps:
- name: Resolve tag
id: tag
run: |
TAG="${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}"
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
echo "version=${TAG#v}" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v7
with:
ref: ${{ steps.tag.outputs.tag }}
- uses: docker/setup-qemu-action@v4
- uses: docker/setup-buildx-action@v4
- uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v7
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
build-args: |
VERSION=${{ steps.tag.outputs.version }}
tags: |
${{ env.IMAGE }}:${{ steps.tag.outputs.version }}
${{ env.IMAGE }}:latest
labels: |
org.opencontainers.image.source=https://github.com/soren-achebe/backscroll
org.opencontainers.image.description=Terminal output history: record, search, and diff every command's output. MCP server entrypoint.
org.opencontainers.image.licenses=MIT
org.opencontainers.image.version=${{ steps.tag.outputs.version }}
- name: Smoke test published image (MCP stdio)
run: |
docker pull "$IMAGE:${{ steps.tag.outputs.version }}"
printf '%s\n%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"smoke","version":"0"}}}' \
'{"jsonrpc":"2.0","id":2,"method":"tools/list"}' \
| docker run -i --rm "$IMAGE:${{ steps.tag.outputs.version }}" > /tmp/out.jsonl
python3 - <<'EOF'
import json
lines = [json.loads(l) for l in open("/tmp/out.jsonl") if l.strip()]
tools = {t["name"] for r in lines if isinstance(r.get("result"), dict)
for t in r["result"].get("tools", [])}
assert {"search_output", "list_commands", "get_output", "diff_output"} <= tools, tools
print("published-image MCP smoke test OK:", sorted(tools))
EOF