Support building a single DLL (#14) #4
This file contains 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: build-pip | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- '.github/workflows/build-pip.yml' | |
- 'CMakeLists.txt' | |
- 'cmake/**' | |
- 'kaldi-decoder/csrc/**' | |
- 'kaldi-decoder/python/**' | |
- 'setup.py' | |
pull_request: | |
branches: | |
- master | |
paths: | |
- '.github/workflows/build-pip.yml' | |
- 'CMakeLists.txt' | |
- 'cmake/**' | |
- 'kaldi-decoder/csrc/**' | |
- 'kaldi-decoder/python/**' | |
- 'setup.py' | |
workflow_dispatch: | |
concurrency: | |
group: build-pip-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-pip: | |
name: ${{ matrix.os }} ${{ matrix.python-version }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: ccache | |
uses: hendrikmuhs/[email protected] | |
with: | |
key: ${{ matrix.os }}-${{ matrix.python-version }} | |
# see https://github.com/microsoft/setup-msbuild | |
- name: Add msbuild to PATH | |
if: startsWith(matrix.os, 'windows') | |
uses: microsoft/[email protected] | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Build | |
shell: bash | |
run: | | |
export CMAKE_CXX_COMPILER_LAUNCHER=ccache | |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | |
cmake --version | |
python3 -m pip install -U pip wheel numpy setuptools | |
python3 setup.py bdist_wheel | |
ls -lh dist | |
unzip -l ./dist/*.whl | |
python3 -m pip install ./dist/kaldi*.whl | |
cd ../.. | |
python3 -c "import kaldi_decoder; print(kaldi_decoder.__version__)" | |
python3 -c "import kaldi_decoder; print(kaldi_decoder.__file__)" |