Build TA-Lib wheels for Linux #62
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 TA-Lib wheels for Linux | |
on: | |
workflow_dispatch: | |
env: | |
TALIB_C_VER: 0.6.2 | |
TALIB_PY_VER: 0.6.0 | |
PIP_NO_VERIFY: 0 | |
PIP_VERBOSE: 1 | |
CIBW_BUILD_VERBOSITY: 2 | |
jobs: | |
build_manylinux_x86_64: | |
name: Build ManyLinux x86_64 wheels | |
strategy: | |
matrix: | |
os: ["ubuntu-22.04"] | |
runs-on: ${{ matrix.os }} | |
env: | |
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 | |
CIBW_MANYLINUX_I686_IMAGE: manylinux_2_28 | |
CIBW_MANYLINUX_PYPY_X86_64_IMAGE: manylinux_2_28 | |
CIBW_MANYLINUX_PYPY_I686_IMAGE: manylinux_2_28 | |
CIBW_BEFORE_BUILD: pip install setuptools==58.0.1&&pip install -U Cython&&pip install -U wheel numpy | |
CIBW_TEST_REQUIRES: pytest pandas polars | |
CIBW_TEST_COMMAND: > | |
cd .. && | |
pytest -k "not RSI and not threading" {project}/tests | |
CIBW_TEST_SKIP: "*win32 cp37* cp38* cp39*" | |
CIBW_SKIP: "pp* cp*-musllinux*" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install GCC and CMake | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y gcc g++ cmake | |
- name: Verify GCC and CMake | |
run: | | |
gcc --version | |
g++ --version | |
cmake --version | |
- name: Make script executable | |
run: chmod +x build_linux.sh | |
- name: Build TA-Lib | |
run: ./build_linux.sh | |
shell: bash | |
- name: Build wheels | |
uses: pypa/cibuildwheel@v2.22.0 | |
env: | |
CIBW_ARCHS_LINUX: x86_64 | |
CIBW_BUILD_FRONTEND: build | |
CIBW_ENVIRONMENT_LINUX : > | |
TA_LIBRARY_PATH="ta-lib-install/lib" | |
TA_INCLUDE_PATH="ta-lib-install/include" | |
PIP_NO_BUILD_ISOLATION=false | |
CIBW_REPAIR_WHEEL_COMMAND_LINUX: | | |
export LD_LIBRARY_PATH="/project/ta-lib-install/lib:$LD_LIBRARY_PATH" | |
auditwheel repair -w {dest_dir} {wheel} | |
- name: Set wheel name | |
run: | | |
echo "WHEEL_NAME=ta_lib-${{env.TALIB_PY_VER}}-manylinux_x86_64" >> $GITHUB_ENV | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
path: ./wheelhouse/*.whl | |
name: ${{ env.WHEEL_NAME }} | |
build_musllinux_x86_64: | |
name: Build MuslLinux x86_64 wheels | |
strategy: | |
matrix: | |
os: ["ubuntu-22.04"] | |
runs-on: ${{ matrix.os }} | |
env: | |
CIBW_BEFORE_BUILD: pip install setuptools==58.0.1&&pip install -U Cython&&pip install -U wheel numpy | |
CIBW_TEST_REQUIRES: pytest pandas polars | |
CIBW_TEST_COMMAND: > | |
cd .. && | |
pytest -k "not RSI and not threading" {project}/tests | |
CIBW_TEST_SKIP: "*win32 cp37* cp38* cp39*" | |
CIBW_SKIP: "pp* cp*-manylinux*" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup latest Alpine Linux | |
uses: jirutka/setup-alpine@v1 | |
with: | |
branch: v3.15 | |
packages: > | |
build-base | |
gcc | |
g++ | |
cmake | |
volumes: ${{ github.workspace }}:/project | |
- name: Make script executable | |
run: chmod +x build_linux.sh | |
- name: Build TA-Lib | |
run: | | |
cd /project&&./build_linux.sh | |
shell: alpine.sh {0} | |
- name: Build wheels | |
uses: pypa/cibuildwheel@v2.22.0 | |
env: | |
CIBW_ARCHS_LINUX: x86_64 | |
CIBW_BUILD_FRONTEND: build | |
CIBW_ENVIRONMENT_LINUX : > | |
TA_LIBRARY_PATH="ta-lib-install/lib" | |
TA_INCLUDE_PATH="ta-lib-install/include" | |
PIP_NO_BUILD_ISOLATION=false | |
CIBW_REPAIR_WHEEL_COMMAND_LINUX: | | |
export LD_LIBRARY_PATH="/project/ta-lib-install/lib:$LD_LIBRARY_PATH" | |
auditwheel repair -w {dest_dir} {wheel} | |
- name: Set wheel name | |
run: | | |
echo "WHEEL_NAME=ta_lib-${{env.TALIB_PY_VER}}-musllinux_x86_64" >> $GITHUB_ENV | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
path: ./wheelhouse/*.whl | |
name: ${{ env.WHEEL_NAME }} |