chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 13:04:05 +08:00
commit 54d5556870
373 changed files with 47482 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
name: Canary Release
on:
workflow_dispatch:
inputs:
branch:
description: "Branch to release from (defaults to current branch)"
required: false
type: string
jobs:
canary-release:
name: Canary Release
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout Repo
uses: actions/checkout@v7
with:
ref: ${{ inputs.branch || github.ref }}
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: "20"
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Configure npm authentication
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Build all packages
run: pnpm build
- name: Publish Snapshot
run: pnpm release:snapshot
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
+57
View File
@@ -0,0 +1,57 @@
name: Deploy to AWS ECR
on:
workflow_dispatch:
inputs:
version:
description: "Docker image version tag (e.g., v0.0.22)"
required: true
type: string
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v6
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image
id: build-push
uses: docker/build-push-action@v6
with:
context: .
file: packages/mcp/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ secrets.ECR_REGISTRY }}/${{ secrets.ECR_REPOSITORY }}:${{ inputs.version }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Create GitHub Summary
run: |
echo "## Docker Image Deployed Successfully" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Image Tag:** \`${{ inputs.version }}\`" >> $GITHUB_STEP_SUMMARY
echo "**Platforms:** \`linux/amd64\`, \`linux/arm64\`" >> $GITHUB_STEP_SUMMARY
echo "**Digest:** \`${{ steps.build-push.outputs.digest }}\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Status:** ✅ Image pushed to AWS ECR" >> $GITHUB_STEP_SUMMARY
+54
View File
@@ -0,0 +1,54 @@
name: Publish to MCP Registry
on:
workflow_dispatch:
inputs:
version:
description: "Version to publish (defaults to package.json version)"
required: false
type: string
jobs:
publish-mcp:
name: Publish to MCP Registry
runs-on: ubuntu-latest
permissions:
id-token: write # Required for OIDC authentication with MCP Registry
contents: read
steps:
- name: Checkout Repo
uses: actions/checkout@v7
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: lts/*
- name: Set version
run: |
if [ -n "${{ inputs.version }}" ]; then
VERSION="${{ inputs.version }}"
# Remove 'v' prefix if it exists
VERSION="${VERSION#v}"
else
VERSION=$(node -p "require('./packages/mcp/package.json').version")
fi
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Publishing version: $VERSION"
- name: Update package version in server.json
run: |
echo $(jq --arg v "${{ env.VERSION }}" '.version = $v | .packages[0].version = $v' server.json) > server.json
- name: Validate server.json
run: npx mcp-registry-validator validate server.json
- name: Install MCP Publisher
run: |
curl -L "https://github.com/modelcontextprotocol/registry/releases/download/v1.4.0/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher
- name: Login to MCP Registry
run: ./mcp-publisher login github-oidc
- name: Publish to MCP Registry
run: ./mcp-publisher publish
+50
View File
@@ -0,0 +1,50 @@
name: Release
on:
push:
branches:
- master
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout Repo
uses: actions/checkout@v7
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: "20"
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Configure npm authentication
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Build all packages
run: pnpm build
- name: Create Release PR or Publish
id: changesets
uses: changesets/action@v1
with:
publish: pnpm release
commit: "chore(release): version packages"
title: "chore(release): version packages"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
+72
View File
@@ -0,0 +1,72 @@
name: Test
on:
pull_request:
paths:
- "packages/**"
- "package.json"
- "pnpm-lock.yaml"
- "pnpm-workspace.yaml"
- "tsconfig.json"
- "eslint.config.js"
- "prettier.config.mjs"
- ".github/workflows/test.yml"
push:
branches: [master]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: "20"
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Cache pnpm dependencies
uses: actions/cache@v6
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Lint
run: pnpm lint:check
- name: Format
run: pnpm format:check
- name: Build
run: pnpm build
- name: Typecheck
run: pnpm typecheck
- name: Test
run: pnpm test
env:
AWS_REGION: ${{ secrets.AWS_REGION }}
AWS_BEARER_TOKEN_BEDROCK: ${{ secrets.AWS_BEARER_TOKEN_BEDROCK }}
CONTEXT7_API_KEY: ${{ secrets.CONTEXT7_API_KEY }}
@@ -0,0 +1,40 @@
name: Triage library report
# When a "Library Report" issue is opened, forward it to the triage service so the agent can
# analyze it and post its findings as a comment.
#
# Cross-repo note: this issue lives here (upstash/context7) but the triage agent + its secrets
# (Redis/Vector/model creds + a token that can comment on this repo) live in the context7app
# deployment. A GitHub Action here cannot run the agent, so it only forwards the issue number to
# the app's endpoint with a shared secret; the app runs the read-only agent and posts the comment.
#
# Required repo secrets (Settings → Secrets and variables → Actions):
# TRIAGE_WEBHOOK_URL https://<context7app-domain>/api/triage/analyze
# TRIAGE_WEBHOOK_SECRET same value as TRIAGE_WEBHOOK_SECRET in the context7app environment
on:
issues:
types: [opened]
permissions: {} # no GITHUB_TOKEN needed — the app comments with its own token
jobs:
triage:
if: contains(github.event.issue.title, 'Library Report')
runs-on: ubuntu-latest
steps:
- name: Forward to triage service
env:
TRIAGE_WEBHOOK_URL: ${{ secrets.TRIAGE_WEBHOOK_URL }}
TRIAGE_WEBHOOK_SECRET: ${{ secrets.TRIAGE_WEBHOOK_SECRET }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
run: |
if [ -z "$TRIAGE_WEBHOOK_URL" ]; then
echo "TRIAGE_WEBHOOK_URL not configured; skipping triage."
exit 0
fi
echo "Triaging issue #$ISSUE_NUMBER"
curl -fsS --max-time 180 -X POST "$TRIAGE_WEBHOOK_URL" \
-H "Authorization: Bearer $TRIAGE_WEBHOOK_SECRET" \
-H "Content-Type: application/json" \
-d "{\"issueNumber\": $ISSUE_NUMBER}"