Skip to content

Update 2 agents to latest versions #1955

Update 2 agents to latest versions

Update 2 agents to latest versions #1955

name: Build Registry
on:
push:
branches: [main]
paths:
- "*/agent.json"
- "*/icon.svg"
- ".github/workflows/**"
- "*.schema.json"
- "quarantine.json"
pull_request:
branches: [main]
paths:
- "*/agent.json"
- "*/icon.svg"
- ".github/workflows/**"
- "*.schema.json"
- "quarantine.json"
workflow_dispatch:
permissions:
contents: read
jobs:
lint-and-test:
name: Lint & Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990
- name: Ruff check
working-directory: .github/workflows
run: uv run --with ruff ruff check .
- name: Ruff format check
working-directory: .github/workflows
run: uv run --with ruff ruff format --check .
- name: Run tests
working-directory: .github/workflows
run: uv run --with pytest pytest tests/ -v
build:
name: Build & Validate
needs: lint-and-test
runs-on: ubuntu-latest
outputs:
agent_ids: ${{ steps.list-agents.outputs.ids }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: "lts/*"
- name: Validate and build
run: uv run --with jsonschema .github/workflows/build_registry.py
- name: List agents for auth matrix
id: list-agents
run: |
IDS=$(python3 .github/workflows/verify_agents.py --list-ids)
echo "ids=$IDS" >> "$GITHUB_OUTPUT"
- name: List dist
run: ls -la dist/
- name: Upload artifacts
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: registry
path: dist/
verify-auth:
name: Auth (${{ matrix.agent_id }})
needs: build
if: needs.build.outputs.agent_ids != '[]'
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
fail-fast: false
matrix:
agent_id: ${{ fromJson(needs.build.outputs.agent_ids) }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: "lts/*"
- name: Verify auth
env:
AGENT_ID: ${{ matrix.agent_id }}
run: python3 .github/workflows/verify_agents.py --auth-check --agent "$AGENT_ID"
upload:
name: Upload to S3
needs: [build, verify-auth]
if: always() && !failure() && !cancelled() && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
env:
S3_PREFIX: registry/v1
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Download artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: registry
path: dist/
- name: Configure AWS CLI for R2
run: |
aws configure set aws_access_key_id "${{ secrets.S3_ACCESS_KEY_ID }}"
aws configure set aws_secret_access_key "${{ secrets.S3_SECRET_ACCESS_KEY }}"
aws configure set default.region auto
- name: Generate version string
id: version
run: echo "version=v$(date +%Y.%m.%d)-$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
- name: Upload versioned snapshot
env:
S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }}
S3_BUCKET: ${{ secrets.S3_BUCKET }}
run: |
aws s3 sync dist/ "s3://${S3_BUCKET}/${S3_PREFIX}/${{ steps.version.outputs.version }}/" \
--endpoint-url "${S3_ENDPOINT}" \
--cache-control "public, max-age=31536000, immutable"
- name: Upload to latest
env:
S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }}
S3_BUCKET: ${{ secrets.S3_BUCKET }}
run: |
aws s3 sync dist/ "s3://${S3_BUCKET}/${S3_PREFIX}/latest/" \
--endpoint-url "${S3_ENDPOINT}" \
--cache-control "public, max-age=300" \
--delete
- name: Print CDN URLs
run: |
echo "## Uploaded to S3" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "Versioned: \`${S3_PREFIX}/${{ steps.version.outputs.version }}/\`" >> "$GITHUB_STEP_SUMMARY"
echo "Latest: \`${S3_PREFIX}/latest/\`" >> "$GITHUB_STEP_SUMMARY"
release:
name: Publish GitHub Release
needs: [build, verify-auth]
if: always() && !failure() && !cancelled() && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
persist-credentials: false
- name: Download artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: registry
path: dist/
# Generating a GitHub token, so that PRs and tags created by
# the action can trigger actions workflows.
- name: Generate GitHub token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1
id: generate-token
with:
# GitHub App ID secret name
app-id: ${{ secrets.RELEASE_PLZ_APP_ID }}
# GitHub App private key secret name
private-key: ${{ secrets.RELEASE_PLZ_APP_PRIVATE_KEY }}
- name: Generate release notes
id: notes
run: |
# Find the previous release tag
PREV_TAG=$(gh release list --limit 1 --json tagName --jq '.[0].tagName' 2>/dev/null || true)
if [ -n "$PREV_TAG" ]; then
# Collect commit messages since the last release
NOTES=$(git log "$PREV_TAG"..HEAD --pretty=format:"- %s" --no-merges)
else
NOTES="- Initial release"
fi
NOTES_DELIMITER="$(uuidgen)"
{
echo "notes<<$NOTES_DELIMITER"
printf '%s\n' "$NOTES"
echo "$NOTES_DELIMITER"
} >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
- name: Publish release
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
RELEASE_NOTES: ${{ steps.notes.outputs.notes }}
run: |
VERSION="v$(date +%Y.%m.%d)-$(git rev-parse --short HEAD)"
gh release create "$VERSION" \
--title "Registry $VERSION" \
--notes "$RELEASE_NOTES" \
dist/registry.json \
dist/registry-for-jetbrains.json \
dist/agent.schema.json \
dist/registry.schema.json \
dist/*.svg