|
61 | 61 | labels: ${{ steps.meta.outputs.labels }} |
62 | 62 | cache-from: type=gha |
63 | 63 | cache-to: type=gha,mode=max |
| 64 | + |
| 65 | + verify-public-access: |
| 66 | + name: Verify Anonymous GHCR Pull Access |
| 67 | + runs-on: ubuntu-latest |
| 68 | + needs: publish |
| 69 | + if: needs.publish.result == 'success' |
| 70 | + timeout-minutes: 10 |
| 71 | + steps: |
| 72 | + - name: Verify anonymous manifest access (with retry) |
| 73 | + run: | |
| 74 | + set -euo pipefail |
| 75 | + image="ghcr.io/gleanwork/local-mcp-server:latest" |
| 76 | + attempts=18 |
| 77 | + sleep_seconds=10 |
| 78 | + success=0 |
| 79 | +
|
| 80 | + for attempt in $(seq 1 "${attempts}"); do |
| 81 | + if docker manifest inspect "${image}" >/dev/null 2>&1; then |
| 82 | + success=1 |
| 83 | + echo "Anonymous manifest access verified for ${image}" |
| 84 | + break |
| 85 | + fi |
| 86 | +
|
| 87 | + echo "Attempt ${attempt}/${attempts}: ${image} not anonymously available yet" |
| 88 | + sleep "${sleep_seconds}" |
| 89 | + done |
| 90 | +
|
| 91 | + if [[ "${success}" -ne 1 ]]; then |
| 92 | + echo "::error title=Anonymous GHCR pull failed::Unable to pull ${image} without authentication. Set GitHub Packages visibility to Public for ghcr.io/gleanwork/local-mcp-server." |
| 93 | + exit 1 |
| 94 | + fi |
| 95 | +
|
| 96 | + - name: Pull and smoke test image anonymously |
| 97 | + run: | |
| 98 | + set -euo pipefail |
| 99 | + image="ghcr.io/gleanwork/local-mcp-server:latest" |
| 100 | +
|
| 101 | + docker pull "${image}" |
| 102 | + docker run --rm --entrypoint node "${image}" --version |
| 103 | +
|
| 104 | + init_payload='{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"gh-actions","version":"1.0"}}}' |
| 105 | + printf '%s\n' "${init_payload}" | docker run --rm -i "${image}" > /tmp/mcp-init.txt 2>&1 & |
| 106 | + docker_pid=$! |
| 107 | + sleep 3 |
| 108 | +
|
| 109 | + if kill -0 "${docker_pid}" 2>/dev/null; then |
| 110 | + kill "${docker_pid}" 2>/dev/null || true |
| 111 | + wait "${docker_pid}" 2>/dev/null || true |
| 112 | + fi |
| 113 | +
|
| 114 | + if grep -q '"result"' /tmp/mcp-init.txt; then |
| 115 | + echo "MCP initialize handshake succeeded" |
| 116 | + else |
| 117 | + echo "::error title=Docker runtime smoke test failed::MCP initialize response missing from container output" |
| 118 | + cat /tmp/mcp-init.txt |
| 119 | + exit 1 |
| 120 | + fi |
0 commit comments