Update 2 agents to latest versions #530
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Registry | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "*/agent.json" | |
| - "*/icon.svg" | |
| - ".github/workflows/**" | |
| - "*.schema.json" | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - "*/agent.json" | |
| - "*/icon.svg" | |
| - ".github/workflows/**" | |
| - "*.schema.json" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint-and-test: | |
| name: Lint & Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 | |
| - 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 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "lts/*" | |
| - name: Validate and build | |
| run: uv run --with jsonschema .github/workflows/build_registry.py | |
| - name: Verify agent auth support | |
| timeout-minutes: 15 | |
| run: python3 .github/workflows/verify_agents.py --auth-check | |
| - name: List dist | |
| run: ls -la dist/ | |
| - name: Upload artifacts | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: registry | |
| path: dist/ | |
| upload: | |
| name: Upload to S3 | |
| needs: build | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| env: | |
| S3_PREFIX: registry/v1 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Download artifacts | |
| uses: actions/download-artifact@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 | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Download artifacts | |
| uses: actions/download-artifact@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@29824e69f54612133e76f7eaac726eef6c875baf | |
| 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 | |
| echo "notes<<EOF" >> "$GITHUB_OUTPUT" | |
| echo "$NOTES" >> "$GITHUB_OUTPUT" | |
| echo "EOF" >> "$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/agent.schema.json \ | |
| dist/registry.schema.json \ | |
| dist/*.svg |