Patches #265
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: Patches | |
| on: | |
| schedule: | |
| - cron: "0 14 * * *" | |
| workflow_dispatch: | |
| push: | |
| jobs: | |
| checkout: | |
| name: Checkout PDFium | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Install depot_tools | |
| run: | | |
| git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git | |
| echo "$PWD/depot_tools" >> $GITHUB_PATH | |
| - name: Checkout PDFium | |
| run: | | |
| PDFium_BRANCH=$(git ls-remote --sort version:refname --refs https://pdfium.googlesource.com/pdfium.git 'chromium/*' | tail -n 1 | cut -d/ -f3-4) | |
| echo "Checking out branch $PDFium_BRANCH" | |
| gclient config --unmanaged "https://pdfium.googlesource.com/pdfium.git" | |
| gclient sync -r "origin/${PDFium_BRANCH}" --no-history --shallow | |
| - name: Upload PDFium artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: pdfium | |
| path: | | |
| pdfium/**/*.h | |
| pdfium/**/*.cpp | |
| pdfium/**/*.gn | |
| pdfium/**/*.gni | |
| retention-days: 1 | |
| apply-patches: | |
| name: Apply patches | |
| runs-on: ubuntu-latest | |
| needs: checkout | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - android | |
| - ios | |
| - linux | |
| - macos | |
| - win | |
| v8: | |
| - false | |
| - true | |
| include: | |
| - os: linux | |
| environment: musl | |
| - os: emscripten | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Download PDFium artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: pdfium | |
| path: pdfium | |
| - name: Apply patches | |
| run: steps/03-patch.sh | |
| env: | |
| PDFium_TARGET_OS: ${{ matrix.os }} | |
| PDFium_ENABLE_V8: ${{ matrix.v8 || 'false' }} | |
| PDFium_TARGET_ENVIRONMENT: ${{ matrix.environment || '' }} | |
| - name: Print .rej files to build summary | |
| if: failure() | |
| run: | | |
| { | |
| echo "## Rejected patches"; | |
| echo "The following patches for the configuration ${{ matrix.os }} ${{ matrix.v8 && 'v8' || '' }} ${{ matrix.environment || '' }} were rejected:"; | |
| find pdfium -name '*.rej' -type f \ | |
| -printf '### `%P`\n```patch\n' \ | |
| -exec cat {} \; \ | |
| -printf '```\n' || \ | |
| echo 'No .rej files found'; | |
| } >> $GITHUB_STEP_SUMMARY |