Browser UA, optional deps auto-install, --js Playwright fetch for bot… #4
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
| # Build basic-scraper: PyInstaller bundles on all OS + Docker image. Light runs. | |
| name: Build | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| branches: [main, master] | |
| jobs: | |
| bundle: | |
| name: Bundle (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install deps and bundle tooling | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[bundle]" | |
| - name: Build PyInstaller bundle | |
| run: pyinstaller basic-scraper.spec | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: basic-scraper-${{ matrix.os }} | |
| path: dist/basic-scraper/ | |
| docker: | |
| name: Docker | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: false | |
| load: true | |
| tags: basic-scraper:latest | |
| - name: Smoke test | |
| run: | | |
| docker run --rm basic-scraper:latest --url https://example.com --out-dir /tmp/out --types text 2>&1 | head -20 |