Skip to content

Build and Release Patched Patchright #2

Build and Release Patched Patchright

Build and Release Patched Patchright #2

Workflow file for this run

name: Build and Release Patched Patchright
on:
workflow_dispatch:
inputs:
playwright_version:
description: 'Playwright-Python version tag (e.g. v1.56.0)'
required: true
default: 'v1.56.0'
patchright_release:
description: 'Patchright release version (e.g. 1.56.0)'
required: true
default: '1.56.0'
permissions:
contents: write
jobs:
build-wheels:
name: Build wheels
runs-on: ubuntu-latest
env:
patchright_release: ${{ github.event.inputs.patchright_release }}
playwright_version: ${{ github.event.inputs.playwright_version }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Set up Python
run: uv python install 3.11
- name: Install dependencies
run: |
uv sync --all-groups
git clone https://github.com/microsoft/playwright-python --branch "$playwright_version"
uv add -r playwright-python/local-requirements.txt --dev
- name: Patch Playwright-Python Package
run: uv run patch_python_package.py
- name: Format patched code
run: uvx ruff format playwright-python || true
- name: Build wheels
run: |
cd playwright-python
uv pip install -e .
for wheel in $(uv run setup.py --list-wheels); do
PLAYWRIGHT_TARGET_WHEEL=$wheel uv build --wheel
done
- name: Upload wheel artifacts
uses: actions/upload-artifact@v4
with:
name: wheels
path: playwright-python/dist/*.whl
release:
name: Create GitHub Release
needs: build-wheels
runs-on: ubuntu-latest
steps:
- name: Download wheel artifacts
uses: actions/download-artifact@v4
with:
name: wheels
path: dist/
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ github.event.inputs.patchright_release }}
name: patchright v${{ github.event.inputs.patchright_release }}
body: |
Custom patchright build with networkidle captcha blacklisting.
Based on playwright-python ${{ github.event.inputs.playwright_version }}.
**Captcha domains excluded from networkidle:**
- challenges.cloudflare.com (Cloudflare Turnstile)
- google.com/recaptcha (reCAPTCHA)
- www.gstatic.com/recaptcha (reCAPTCHA assets)
- hcaptcha.com (hCaptcha)
- api.funcaptcha.com (Arkose Labs)
- client-api.arkoselabs.com (Arkose Labs)
Install: `pip install patchright@https://github.com/bugbasesecurity/patchright-python/releases/download/v${{ github.event.inputs.patchright_release }}/patchright-${{ github.event.inputs.patchright_release }}-py3-none-manylinux1_x86_64.whl`
files: dist/*.whl
draft: false
prerelease: false