chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
name: 'Conventional Commit'
|
||||
|
||||
on:
|
||||
merge_group:
|
||||
pull_request_target:
|
||||
types:
|
||||
# Defaults
|
||||
# https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request_target
|
||||
- opened
|
||||
- reopened
|
||||
- synchronize
|
||||
# Tracks editing PR title or description, or base branch changes
|
||||
# https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=edited#pull_request
|
||||
- edited
|
||||
|
||||
jobs:
|
||||
main:
|
||||
name: '[Required] Validate PR title'
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: read
|
||||
steps:
|
||||
- if: github.event_name != 'merge_group'
|
||||
uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -0,0 +1,44 @@
|
||||
name: Pre-release
|
||||
|
||||
permissions: read-all
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- release-please-*
|
||||
|
||||
jobs:
|
||||
pre-release:
|
||||
name: 'Verify artifacts before release'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||
with:
|
||||
cache: npm
|
||||
node-version-file: '.nvmrc'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
|
||||
# Ensure npm 11.5.1 or later is installed
|
||||
- name: Update npm
|
||||
run: npm install -g npm@latest
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build and bundle
|
||||
run: npm run bundle
|
||||
env:
|
||||
NODE_ENV: 'production'
|
||||
|
||||
- name: Verify server.json
|
||||
run: npm run verify-server-json-version
|
||||
|
||||
- name: Verify npm package
|
||||
run: npm run verify-npm-package
|
||||
@@ -0,0 +1,67 @@
|
||||
name: Check code before submitting
|
||||
|
||||
permissions: read-all
|
||||
|
||||
on:
|
||||
merge_group:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
check-format:
|
||||
name: '[Required] Check correct format'
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||
with:
|
||||
cache: npm
|
||||
node-version-file: '.nvmrc'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Run format check
|
||||
run: npm run check-format
|
||||
|
||||
check-docs:
|
||||
name: '[Required] Check docs updated'
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||
with:
|
||||
cache: npm
|
||||
node-version-file: '.nvmrc'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Generate
|
||||
run: npm run gen
|
||||
|
||||
- name: Check if autogenerated code and docs are out of date
|
||||
run: |
|
||||
diff_file=$(mktemp doc_diff_XXXXXX)
|
||||
git diff --color > $diff_file
|
||||
if [[ -s $diff_file ]]; then
|
||||
echo "Please update the documentation by running 'npm run gen'. The following was the diff"
|
||||
cat $diff_file
|
||||
rm $diff_file
|
||||
exit 1
|
||||
fi
|
||||
rm $diff_file
|
||||
@@ -0,0 +1,101 @@
|
||||
name: publish-on-tag
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'chrome-devtools-mcp-v*'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
npm-publish:
|
||||
description: 'Try to publish to npm'
|
||||
default: false
|
||||
type: boolean
|
||||
mcp-publish:
|
||||
description: 'Try to publish to MCP registry'
|
||||
default: true
|
||||
type: boolean
|
||||
|
||||
permissions:
|
||||
id-token: write # Required for OIDC
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
publish-to-npm:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ (github.event_name != 'workflow_dispatch') || (inputs.npm-publish && always()) }}
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||
with:
|
||||
cache: npm
|
||||
node-version-file: '.nvmrc'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build and bundle
|
||||
run: npm run bundle
|
||||
env:
|
||||
NODE_ENV: 'production'
|
||||
|
||||
- name: Publish chrome-devtools-mcp
|
||||
run: |
|
||||
npm publish --provenance --access public
|
||||
|
||||
- name: Publish chrome-devtools
|
||||
run: |
|
||||
node --input-type=module --eval '
|
||||
import * as fs from "node:fs/promises";
|
||||
const json = await fs.readFile("package.json", "utf8");
|
||||
const pkg = JSON.parse(json);
|
||||
pkg.name = "chrome-devtools";
|
||||
await fs.writeFile("package.json", JSON.stringify(pkg, null, 2) + "\n");
|
||||
'
|
||||
echo 'This is the **Chrome DevTools for agents** package. Docs: https://github.com/ChromeDevTools/chrome-devtools-mcp' > README.md
|
||||
npm publish --provenance --access public
|
||||
|
||||
publish-to-mcp-registry:
|
||||
runs-on: ubuntu-latest
|
||||
needs: publish-to-npm
|
||||
if: ${{ (github.event_name != 'workflow_dispatch' && needs.publish-to-npm.result == 'success') || (inputs.mcp-publish && always()) }}
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||
with:
|
||||
cache: npm
|
||||
node-version-file: '.nvmrc'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
|
||||
# Ensure npm 11.5.1 or later is installed
|
||||
- name: Update npm
|
||||
run: npm install -g npm@latest
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build and bundle
|
||||
run: npm run bundle
|
||||
env:
|
||||
NODE_ENV: 'production'
|
||||
|
||||
- name: Install MCP Publisher
|
||||
run: |
|
||||
export OS=$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')
|
||||
curl -L "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_${OS}.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
|
||||
@@ -0,0 +1,18 @@
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
permissions: read-all
|
||||
name: release-please
|
||||
|
||||
jobs:
|
||||
release-please:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: googleapis/release-please-action@v5
|
||||
with:
|
||||
token: ${{ secrets.BROWSER_AUTOMATION_BOT_TOKEN }}
|
||||
target-branch: main
|
||||
config-file: release-please-config.json
|
||||
manifest-file: .release-please-manifest.json
|
||||
@@ -0,0 +1,83 @@
|
||||
name: Compile and run tests
|
||||
|
||||
permissions: read-all
|
||||
|
||||
on:
|
||||
merge_group:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
run-tests:
|
||||
name: Tests on ${{ matrix.os }} with node ${{ matrix.node }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- windows-latest
|
||||
- macos-latest
|
||||
node:
|
||||
- 22
|
||||
- 24
|
||||
- 26
|
||||
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||
with:
|
||||
cache: npm
|
||||
node-version: 22 # build works only with 22+.
|
||||
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: npm ci
|
||||
env:
|
||||
PUPPETEER_SKIP_DOWNLOAD: true
|
||||
|
||||
- name: Install browser
|
||||
shell: bash
|
||||
run: npx puppeteer browsers install chrome
|
||||
|
||||
- name: Build
|
||||
run: npm run bundle
|
||||
env:
|
||||
NODE_OPTIONS: '--max_old_space_size=4096'
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||
with:
|
||||
cache: npm
|
||||
node-version: ${{ matrix.node }}
|
||||
|
||||
- name: Disable AppArmor
|
||||
if: ${{ matrix.os == 'ubuntu-latest' }}
|
||||
shell: bash
|
||||
run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns
|
||||
|
||||
- name: Run tests
|
||||
shell: bash
|
||||
# Retry tests if they fail in the merge queue.
|
||||
run: >
|
||||
npm run test:no-build --
|
||||
${{ matrix.os == 'windows-latest' && '--test-concurrency=1' || '' }}
|
||||
${{ github.event_name == 'merge_group' && '--retry' || '' }}
|
||||
|
||||
# Gating job for branch protection.
|
||||
test-success:
|
||||
name: '[Required] Tests passed'
|
||||
runs-on: ubuntu-latest
|
||||
needs: run-tests
|
||||
if: ${{ !cancelled() }}
|
||||
steps:
|
||||
- if: ${{ needs.run-tests.result != 'success' }}
|
||||
run: 'exit 1'
|
||||
- run: 'exit 0'
|
||||
Reference in New Issue
Block a user