From 00e540b8d0390e1f1fab901c968411504d8706ff Mon Sep 17 00:00:00 2001 From: Benjamin Dornel Date: Fri, 7 Jun 2024 21:36:38 +0800 Subject: [PATCH] chore: build pyodide wheel --- .github/workflows/build_pyodide.yml | 60 +++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/build_pyodide.yml diff --git a/.github/workflows/build_pyodide.yml b/.github/workflows/build_pyodide.yml new file mode 100644 index 0000000..82d89a4 --- /dev/null +++ b/.github/workflows/build_pyodide.yml @@ -0,0 +1,60 @@ +name: Build Pyodide wheel + +on: + push: + + inputs: + PYMUPDF_SETUP_MUPDF_BUILD: + description: 'Value for PYMUPDF_SETUP_MUPDF_BUILD, e.g.: git:--branch master https://github.com/ArtifexSoftware/mupdf.git' + type: string + + schedule: + - cron: '13 5 * * *' + +jobs: + + build_pyodide: + + name: Build pyodide wheel + runs-on: ubuntu-latest + + strategy: + matrix: + # 2023-12-22: Python-3.12 is known to fail, due to setuptools trying to + # import distutils. + python-version: ["3.12"] + + # Avoid cancelling of all runs after a single failure. + fail-fast: false + + steps: + + - uses: actions/checkout@v2 + with: + repository: pymupdf/PyMuPDF + + # - name: Override gh_release.py + # run: | + # echo "Replacing scripts/gh_release.py with custom file" + # cp gh_release.py scripts/gh_release.py + + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: build_pyodide_wheel + env: + inputs_sdist: 0 + inputs_PYMUPDF_SETUP_MUPDF_BUILD: ${{inputs.PYMUPDF_SETUP_MUPDF_BUILD}} + inputs_wheels_default: 0 + inputs_wheels_linux_pyodide: 1 + inputs_wheels_implementations: b + run: + sudo apt-get install python3-distutils && python scripts/gh_release.py build + + + # Upload generated wheels, to be accessible from github Actions page. + # + - uses: actions/upload-artifact@v2 + with: + path: ./wheelhouse/*.whl