Update publish.yml #75
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: tests | |
on: [push, pull_request] | |
jobs: | |
Tests: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
# Oldest and newest versions should be enough. Python versions are supported 5 years from release date. | |
# 3.5 was released 2015-09-13 and end-of-life was 2020-09-13 | |
# 3.6 was released 2016-12-23 and end-of-life will be 2021-12-23 | |
# 3.7 was released 2018-06-27 and end-of-life will be 2023-06-27 | |
# 3.8 was released 2019-10-14 and end-of-life will be 2024-10-14 | |
# 3.9 was released 2020-10-05 and end-of-life will be 2025-10-25 | |
# 3.10 was released 2021-10-04 and end-of-life will be 2026-10-25 | |
# 3.11 was released 2022-10-24 and end-of-life will be 2027-10-24 | |
# 3.12 was released 2023-10-02 and end-of-life will be 2028-10 | |
python-version: ['3.8', '3.12'] | |
#os: [macos-13, macos-14, ubuntu-latest, windows-latest] | |
os: [macos-13, ubuntu-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Dependencies (macos) | |
if: matrix.os == 'macos-13' || matrix.os == 'macos-14' | |
run: | | |
brew update && brew reinstall zstd | |
- name: Install Dependencies (ubuntu) | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get -y install libzstd-dev g++ | |
- name: Install Dependencies (windows) | |
if: matrix.os == 'windows-latest' | |
run: | | |
python libzstd/_get_zstd.py | |
copy libzstd/lib/libzstd.dll C:\Windows\System32\ | |
regsvr32 C:\Windows\System32\libzstd.dll | |
- name: Install Python Modules | |
run: | | |
python3 -m pip install --upgrade pip | |
python3 -m pip install --upgrade-strategy eager --upgrade cython twine cibuildwheel setuptools | |
- name: Test Installation From Tarball | |
shell: bash | |
env: | |
LIBZSTD_DIR: ${{ github.workspace }}\libzstd # windows | |
run: | | |
python3 setup.py sdist | |
twine check dist/* | |
python3 -m pip install dist/*.tar.gz | |
- name: Test ZSTD Decoder Python Package | |
# indexed_zstd should be installed for this step! | |
run: | | |
cd test | |
python3 test.py | |
Build-Wheels: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
#os: [macos-13, macos-14, ubuntu-latest, windows-latest] | |
os: [macos-13, ubuntu-latest, windows-latest] | |
manylinux-image: [manylinux2014] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.12' | |
- name: Install Python Dependencies | |
run: | | |
python3 -m pip install --upgrade pip | |
python3 -m pip install --upgrade-strategy eager --upgrade cython twine cibuildwheel setuptools | |
- name: Build Tarball | |
if: matrix.os == 'ubuntu-latest' | |
run: python3 setup.py sdist | |
- name: Build Wheels | |
env: | |
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux-image }} | |
CIBW_MUSLLINUX_X86_64_IMAGE: musllinux_1_1 | |
CIBW_ARCHS: auto64 | |
CIBW_ARCHS_MACOS: "x86_64 arm64" | |
CIBW_BEFORE_ALL_LINUX: yum install -y libzstd-devel || apk add zstd-dev | |
CIBW_BEFORE_ALL_MACOS: brew update && brew reinstall zstd | |
CIBW_BEFORE_BUILD_WINDOWS: "python {package}/libzstd/_get_zstd.py && pip install delvewheel" | |
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -w {dest_dir} {wheel}" | |
run: python -m cibuildwheel --output-dir dist | |
- name: Check Wheels | |
run: twine check dist/* |