PyPI #6
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: PyPI | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - "py-v*" | |
| jobs: | |
| build-wheels: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-14] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: "temurin" | |
| java-version: "25" | |
| cache: "maven" | |
| - name: Build tabula fat jar | |
| shell: bash | |
| run: mvn --batch-mode compile assembly:single -Dmaven.test.skip=true | |
| - name: Stage tabula jar for wheel builds | |
| shell: bash | |
| run: | | |
| JAR_PATH="$(ls -1 target/tabula-*-jar-with-dependencies.jar | head -n 1)" | |
| cp "$JAR_PATH" python/tabula.jar | |
| - name: Build bundled runtime | |
| run: python python/scripts/prepare_bundle.py | |
| - name: Build wheels | |
| uses: pypa/cibuildwheel@v2.23.2 | |
| env: | |
| CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-*" | |
| CIBW_SKIP: "pp* *-musllinux* *-manylinux_i686 *-win32" | |
| CIBW_TEST_COMMAND: "tabula-java --version" | |
| with: | |
| package-dir: python | |
| output-dir: wheelhouse | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheels-${{ matrix.os }} | |
| path: wheelhouse/*.whl | |
| publish-pypi: | |
| needs: [build-wheels] | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/py-v') | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| pattern: wheels-* | |
| path: dist | |
| merge-multiple: true | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 |