We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/codeiva4u/Brave-Real-Browser-Mcp-Server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
name: Chrome Launcher Sync & Publish
on:
# Automatic triggers
schedule:
# Daily trigger - Every day at 6 AM UTC (11:30 AM IST)
- cron: '0 6 * * *'
# Manual trigger
workflow_dispatch:
inputs:
chrome_launcher_version:
description: 'Chrome-launcher version to sync (leave empty for latest)'
required: false
default: 'latest'
force_publish:
description: 'Force publish even if no updates'
type: boolean
default: false
skip_tests:
description: 'Skip tests (use carefully)'
type: boolean
default: false
# Trigger on push to main (for testing)
push:
branches: [ main, master ]
paths:
- 'scripts/chrome-launcher-sync.cjs'
- '.github/workflows/chrome-launcher-sync.yml'
env:
NODE_VERSION: '18'
REGISTRY_URL: 'https://registry.npmjs.org'
jobs:
check-updates:
name: Check for Chrome-launcher Updates
runs-on: ubuntu-latest
outputs:
has_updates: ${{ steps.check.outputs.has_updates }}
chrome_version: ${{ steps.check.outputs.chrome_version }}
current_version: ${{ steps.check.outputs.current_version }}
should_proceed: ${{ steps.check.outputs.should_proceed }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
- name: Install Dependencies
run: npm ci
- name: Check Chrome-launcher Updates & Version Management
id: check
run: |
echo "π Checking for chrome-launcher updates and version management..."
# Get current version from package.json
CURRENT_VERSION=$(node -p "require('./package.json').version")
echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
echo "Current brave-real-launcher version: $CURRENT_VERSION"
# Get latest chrome-launcher version
if [ "${{ github.event.inputs.chrome_launcher_version }}" = "latest" ] || [ -z "${{ github.event.inputs.chrome_launcher_version }}" ]; then
# Get latest chrome-launcher version from npm
CHROME_VERSION=$(npm view chrome-launcher version)
echo "chrome_version=$CHROME_VERSION" >> $GITHUB_OUTPUT
echo "Latest chrome-launcher version: $CHROME_VERSION"
else
CHROME_VERSION="${{ github.event.inputs.chrome_launcher_version }}"
echo "chrome_version=$CHROME_VERSION" >> $GITHUB_OUTPUT
echo "Target chrome-launcher version: $CHROME_VERSION"
fi
# Smart version increment logic - ALWAYS proceed for continuous updates
FORCE_PUBLISH="${{ github.event.inputs.force_publish }}"
# Use version increment utility to determine if we should proceed
echo "π¦ Running version increment analysis..."
node scripts/version-increment.cjs --dry-run --force
# We always proceed now for continuous integration
echo "has_updates=true" >> $GITHUB_OUTPUT
echo "should_proceed=true" >> $GITHUB_OUTPUT
if [ "$CURRENT_VERSION" != "$CHROME_VERSION" ]; then
echo "β
Chrome-launcher version sync available: $CURRENT_VERSION β $CHROME_VERSION"
else
echo "π Auto-increment for continuous updates: $CURRENT_VERSION β $CURRENT_VERSION+1"
fi
echo "π Proceeding with sync and version increment"
sync-and-build:
name: Sync Chrome-launcher & Build
runs-on: ubuntu-latest
needs: check-updates
# Always run for continuous version updates
if: always() && needs.check-updates.outputs.should_proceed == 'true'
outputs:
build_success: ${{ steps.build.outputs.success }}
new_version: ${{ steps.sync.outputs.new_version }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
registry-url: ${{ env.REGISTRY_URL }}
- name: Configure Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Install Dependencies
run: npm ci
- name: Clean up duplicate chrome files
run: |
echo "π§Ή Cleaning up any duplicate chrome files..."
node scripts/cleanup-duplicates.cjs
echo "β
Pre-sync cleanup completed"
- name: Smart Version Increment
id: sync
run: |
echo "π Starting smart version increment..."
OLD_VERSION="${{ needs.check-updates.outputs.current_version }}"
echo "Current version: $OLD_VERSION"
# Use version increment utility directly (more reliable)
echo "π¦ Running version increment..."
node scripts/version-increment.cjs --force
# Get the new version from package.json (after increment)
NEW_VERSION=$(node -p "require('./package.json').version")
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
echo "old_version=$OLD_VERSION" >> $GITHUB_OUTPUT
echo "β
Version increment completed: $OLD_VERSION β $NEW_VERSION"
# Check if version was incremented
if [ "$OLD_VERSION" != "$NEW_VERSION" ]; then
echo "π Version successfully incremented!"
echo "version_incremented=true" >> $GITHUB_OUTPUT
else
echo "βΉοΈ Version remained the same"
echo "version_incremented=false" >> $GITHUB_OUTPUT
fi
- name: Install Updated Dependencies
run: |
echo "π¦ Installing updated dependencies..."
npm install
- name: Build Project
id: build
run: |
echo "π¨ Building project..."
npm run build
echo "success=true" >> $GITHUB_OUTPUT
echo "β
Build completed successfully"
- name: Run Tests
if: github.event.inputs.skip_tests != 'true'
run: |
echo "π§ͺ Running tests..."
npm run test:ci
echo "β
All tests passed"
- name: Verify Build Output
run: |
echo "π Verifying build outputs..."
ls -la dist/
node -e "console.log('β
Build verification:', require('./dist/index.js') ? 'Success' : 'Failed')"
- name: Commit Changes
run: |
if git diff --quiet; then
echo "No changes to commit"
else
git add .
git commit -m "chore: auto-increment version v${{ steps.sync.outputs.new_version }}
- Version increment: ${{ steps.sync.outputs.old_version }} β ${{ steps.sync.outputs.new_version }}
- Chrome-launcher reference: v${{ needs.check-updates.outputs.chrome_version }}
- Build system: β
All tests passing
- Dependencies: β
Up to date
- Features: β
All Brave-specific features preserved
- Continuous updates: β
Smart increment logic
Auto-generated by GitHub Actions"
git push origin ${{ github.ref_name }}
echo "β
Changes committed and pushed"
fi
publish-npm:
name: Publish to NPM
runs-on: ubuntu-latest
needs: [check-updates, sync-and-build]
if: needs.sync-and-build.outputs.build_success == 'true'
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
token: ${{ secrets.GH_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
registry-url: ${{ env.REGISTRY_URL }}
- name: Install Dependencies
run: npm ci
- name: Build for Publication
run: |
echo "π¨ Building for publication..."
npm run build
echo "β
Build completed"
- name: Final Tests Before Publish
if: github.event.inputs.skip_tests != 'true'
run: |
echo "π§ͺ Running final tests..."
npm run test:ci
echo "β
All tests passed"
- name: Check NPM Authentication
run: |
echo "π Checking NPM authentication..."
npm whoami
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Check if Version Already Published
id: version_check
run: |
PACKAGE_NAME=$(node -p "require('./package.json').name")
PACKAGE_VERSION=$(node -p "require('./package.json').version")
echo "Checking if $PACKAGE_NAME@$PACKAGE_VERSION already exists on npm..."
if npm view "$PACKAGE_NAME@$PACKAGE_VERSION" version 2>/dev/null; then
echo "β οΈ Version $PACKAGE_VERSION already published on npm, skipping publish"
echo "skip_publish=true" >> $GITHUB_OUTPUT
else
echo "β
Version $PACKAGE_VERSION not found on npm, proceeding with publish"
echo "skip_publish=false" >> $GITHUB_OUTPUT
fi
echo "package_name=$PACKAGE_NAME" >> $GITHUB_OUTPUT
echo "package_version=$PACKAGE_VERSION" >> $GITHUB_OUTPUT
- name: Publish to NPM
if: steps.version_check.outputs.skip_publish != 'true'
run: |
echo "π¦ Publishing to NPM..."
PACKAGE_NAME="${{ steps.version_check.outputs.package_name }}"
PACKAGE_VERSION="${{ steps.version_check.outputs.package_version }}"
echo "Publishing $PACKAGE_NAME@$PACKAGE_VERSION"
# Publish with retry logic
npm publish --access public
echo "β
Successfully published $PACKAGE_NAME@$PACKAGE_VERSION"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Skip Publish Notice
if: steps.version_check.outputs.skip_publish == 'true'
run: |
echo "β οΈ Skipping npm publish - version already exists"
echo "Package: ${{ steps.version_check.outputs.package_name }}"
echo "Version: ${{ steps.version_check.outputs.package_version }}"
- name: Configure Git for Tag Creation
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Create Git Tag
id: create_tag
run: |
TAG_NAME="v${{ needs.sync-and-build.outputs.new_version }}"
# Check if tag already exists
if git rev-parse "$TAG_NAME" >/dev/null 2>&1; then
echo "β οΈ Tag $TAG_NAME already exists, skipping tag creation"
echo "skip_release=true" >> $GITHUB_OUTPUT
else
git tag -a "$TAG_NAME" -m "Release $TAG_NAME"
git push origin "$TAG_NAME"
echo "β
Created and pushed tag $TAG_NAME"
echo "skip_release=false" >> $GITHUB_OUTPUT
fi
echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT
- name: Create GitHub Release
if: steps.create_tag.outputs.skip_release != 'true'
run: |
TAG_NAME="${{ steps.create_tag.outputs.tag_name }}"
# Check if release already exists
if gh release view "$TAG_NAME" >/dev/null 2>&1; then
echo "β οΈ Release $TAG_NAME already exists, skipping"
exit 0
fi
# Create release body
cat > release_body.md << 'EOF'
## π Chrome-launcher Sync Update
This release automatically syncs with **chrome-launcher v${{ needs.check-updates.outputs.chrome_version }}**
### β¨ What's Updated
- π Synced with chrome-launcher v${{ needs.check-updates.outputs.chrome_version }}
- π¦ All Brave-specific features preserved and enhanced
- π¦ Dependencies updated to latest versions
- π§ͺ All tests passing
- π¨ Build system updated
### π Sync Details
- **Previous version:** ${{ needs.check-updates.outputs.current_version }}
- **New version:** ${{ needs.sync-and-build.outputs.new_version }}
- **Chrome-launcher version:** ${{ needs.check-updates.outputs.chrome_version }}
- **Auto-published:** β
Available on NPM
### π Links
- [NPM Package](https://www.npmjs.com/package/brave-real-launcher)
- [Chrome-launcher Repository](https://github.com/GoogleChrome/chrome-launcher)
---
*This release was automatically generated by GitHub Actions*
EOF
# Create GitHub release using gh CLI
gh release create "$TAG_NAME" \
--title "Release $TAG_NAME" \
--notes-file release_body.md
echo "β
Created GitHub release $TAG_NAME"
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
notify-completion:
name: Notify Completion
runs-on: ubuntu-latest
needs: [check-updates, sync-and-build, publish-npm]
if: always()
steps:
- name: Workflow Summary
run: |
echo "## π― Workflow Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ "${{ needs.check-updates.outputs.should_proceed }}" = "true" ]; then
echo "### β
Updates Processed" >> $GITHUB_STEP_SUMMARY
echo "- **Chrome-launcher version:** ${{ needs.check-updates.outputs.chrome_version }}" >> $GITHUB_STEP_SUMMARY
echo "- **Previous version:** ${{ needs.check-updates.outputs.current_version }}" >> $GITHUB_STEP_SUMMARY
echo "- **New version:** ${{ needs.sync-and-build.outputs.new_version }}" >> $GITHUB_STEP_SUMMARY
if [ "${{ needs.sync-and-build.result }}" = "success" ]; then
echo "- **Sync & Build:** β
Success" >> $GITHUB_STEP_SUMMARY
else
echo "- **Sync & Build:** β Failed" >> $GITHUB_STEP_SUMMARY
fi
if [ "${{ needs.publish-npm.result }}" = "success" ]; then
echo "- **NPM Publish:** β
Success" >> $GITHUB_STEP_SUMMARY
echo "- **Package URL:** https://www.npmjs.com/package/brave-real-launcher" >> $GITHUB_STEP_SUMMARY
else
echo "- **NPM Publish:** β Failed" >> $GITHUB_STEP_SUMMARY
fi
else
echo "### βΉοΈ No Updates Required" >> $GITHUB_STEP_SUMMARY
echo "- Current version is already up-to-date with chrome-launcher" >> $GITHUB_STEP_SUMMARY
echo "- **Current version:** ${{ needs.check-updates.outputs.current_version }}" >> $GITHUB_STEP_SUMMARY
echo "- **Chrome-launcher version:** ${{ needs.check-updates.outputs.chrome_version }}" >> $GITHUB_STEP_SUMMARY
fi
echo "" >> $GITHUB_STEP_SUMMARY
echo "### π Useful Links" >> $GITHUB_STEP_SUMMARY
echo "- [Repository](https://github.com/${{ github.repository }})" >> $GITHUB_STEP_SUMMARY
echo "- [NPM Package](https://www.npmjs.com/package/brave-real-launcher)" >> $GITHUB_STEP_SUMMARY
echo "- [Chrome-launcher](https://github.com/GoogleChrome/chrome-launcher)" >> $GITHUB_STEP_SUMMARY