diff --git a/.github/workflows/build-wheels.yaml b/.github/workflows/build-wheels.yaml new file mode 100644 index 0000000..73ae684 --- /dev/null +++ b/.github/workflows/build-wheels.yaml @@ -0,0 +1,53 @@ +name: build-wheels + +on: + push: + branches: + - wheel + tags: + - '*' + +concurrency: + group: build-wheels-${{ github.ref }} + cancel-in-progress: true + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + + steps: + - uses: actions/checkout@v2 + + # see https://cibuildwheel.readthedocs.io/en/stable/changelog/ + # for a list of versions + - name: Build wheels + uses: pypa/cibuildwheel@v2.11.4 + env: + CIBW_SKIP: "cp27-* cp35-* *-win32 pp* *-musllinux*" + CIBW_BUILD_VERBOSITY: 3 + + - name: Display wheels + shell: bash + run: | + ls -lh ./wheelhouse/ + + ls -lh ./wheelhouse/*.whl + + - uses: actions/upload-artifact@v2 + with: + path: ./wheelhouse/*.whl + + - name: Publish wheels to PyPI + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + shell: bash + run: | + python3 -m pip install --upgrade pip + python3 -m pip install wheel twine setuptools + twine upload ./wheelhouse/*.whl diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml index 93630f6..530cf21 100644 --- a/.github/workflows/conda.yml +++ b/.github/workflows/conda.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: os: [ubuntu-18.04] - python-version: [3.6, 3.7, 3.8, 3.9] + python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] steps: # refer to https://github.com/actions/checkout @@ -25,6 +25,7 @@ jobs: with: auto-update-conda: true python-version: ${{ matrix.python-version }} + channels: conda-forge activate-environment: kaldilm - name: Install conda dependencies diff --git a/.github/workflows/publish_to_pypi.yml b/.github/workflows/publish_to_pypi.yml deleted file mode 100644 index ebbe80d..0000000 --- a/.github/workflows/publish_to_pypi.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Publish to PyPI - -on: - push: - tags: - - '*' - -jobs: - pypi: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: 3.6 - - - name: Install Python dependencies - shell: bash - run: | - python3 -m pip install --upgrade pip - python3 -m pip install wheel twine setuptools - - - name: Build - shell: bash - run: | - python3 setup.py sdist - ls -l dist/* - - - name: Publish wheels to PyPI - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - twine upload dist/kaldilm-*.tar.gz diff --git a/cmake/pybind11.cmake b/cmake/pybind11.cmake index e1daacb..84d38bc 100644 --- a/cmake/pybind11.cmake +++ b/cmake/pybind11.cmake @@ -1,5 +1,3 @@ -# Copyright (c) 2020 Xiaomi Corporation (author: Fangjun Kuang) - function(download_pybind11) if(CMAKE_VERSION VERSION_LESS 3.11) list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules) @@ -7,21 +5,27 @@ function(download_pybind11) include(FetchContent) - set(pybind11_URL "https://github.com/pybind/pybind11/archive/v2.6.0.tar.gz") - set(pybind11_HASH "SHA256=90b705137b69ee3b5fc655eaca66d0dc9862ea1759226f7ccd3098425ae69571") + set(pybind11_URL "https://github.com/pybind/pybind11/archive/refs/tags/v2.10.2.tar.gz") + set(pybind11_HASH "SHA256=93bd1e625e43e03028a3ea7389bba5d3f9f2596abc074b068e70f4ef9b1314ae") + + # If you don't have access to the Internet, please download it to your + # local drive and modify the following line according to your needs. + if(EXISTS "/star-fj/fangjun/download/github/pybind11-2.10.2.tar.gz") + set(pybind11_URL "file:///star-fj/fangjun/download/github/pybind11-2.10.2.tar.gz") + elseif(EXISTS "/Users/fangjun/Downloads/pybind11-2.10.2.tar.gz") + set(pybind11_URL "file:///Users/fangjun/Downloads/pybind11-2.10.2.tar.gz") + elseif(EXISTS "/tmp/pybind11-2.10.2.tar.gz") + set(pybind11_URL "file:///tmp/pybind11-2.10.2.tar.gz") + endif() - set(double_quotes "\"") - set(dollar "\$") - set(semicolon "\;") FetchContent_Declare(pybind11 URL ${pybind11_URL} URL_HASH ${pybind11_HASH} - PATCH_COMMAND ) FetchContent_GetProperties(pybind11) if(NOT pybind11_POPULATED) - message(STATUS "Downloading pybind11") + message(STATUS "Downloading pybind11 from ${pybind11_URL}") FetchContent_Populate(pybind11) endif() message(STATUS "pybind11 is downloaded to ${pybind11_SOURCE_DIR}") @@ -29,3 +33,4 @@ function(download_pybind11) endfunction() download_pybind11() +