Skip to content

bump version

bump version #34

name: Build and upload
on:
push:
branches: master
paths:
- "setup.py"
jobs:
testing:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- name: Checkout Repository And Submodules
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set Up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Display Python Version
run: python -c "import sys; print(sys.version)"
shell: bash
- name: Install Pydivsufsort And Other Dependencies
run: |
python -m pip install pytest flake8
bash ./build.sh
python -m pip install . -v
shell: bash
- name: Run Flake8
run: flake8 .
shell: bash
- name: Run Unit Tests
run: |
pytest tests
shell: bash
build_linux_macos_wheels:
needs: testing
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- name: Checkout Repository And Submodules
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set Up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install build and pip
run: python -m pip install -U pip build
shell: bash
- name: Build Sdist
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
python -m build --sdist
fi
shell: bash
- name: Install Cibuildwheel
run: python -m pip install cibuildwheel
shell: bash
- name: Build Wheels
env:
CIBW_BEFORE_BUILD: pip install -U pip
CIBW_SKIP: pp* *-musllinux_* *-manylinux_i686
CIBW_BUILD_VERBOSITY: 1
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: "pytest {project}/tests"
CIBW_ARCHS_MACOS: x86_64 arm64
run: |
python -m cibuildwheel --output-dir wheelhouse
ls wheelhouse/*
shell: bash
- name: Upload Builds
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python -m pip install twine
if [ "$RUNNER_OS" == "Linux" ]; then
# Replace/remove echo
python -m twine upload --skip-existing dist/*
fi
python -m twine upload --skip-existing wheelhouse/*.whl
shell: bash
build_win32_wheels:
needs: testing
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
steps:
- name: Checkout Repository And Submodules
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set Up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install Cibuildwheel
run: python -m pip install cibuildwheel
shell: bash
- name: Build Wheels
env:
CIBW_BEFORE_BUILD: bash ./build.sh
CIBW_SKIP: pp* *-win_amd64
CIBW_ENVIRONMENT: PLATFORM_OPTION='-A win32'
CIBW_BUILD_VERBOSITY: 1
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: "pytest {project}/tests"
run: |
python -m cibuildwheel --output-dir wheelhouse
ls wheelhouse/*
shell: bash
- name: Upload Builds
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python -m pip install twine
python -m twine upload --skip-existing wheelhouse/*.whl
shell: bash
build_amd64_wheels:
needs: testing
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
steps:
- name: Checkout Repository And Submodules
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set Up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install Cibuildwheel
run: python -m pip install cibuildwheel
shell: bash
- name: Build Wheels
env:
CIBW_BEFORE_BUILD: bash ./build.sh
CIBW_SKIP: pp* *-win32
CIBW_ENVIRONMENT: PLATFORM_OPTION='-A x64'
CIBW_BUILD_VERBOSITY: 1
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: "pytest {project}/tests"
run: |
python -m cibuildwheel --output-dir wheelhouse
ls wheelhouse/*
shell: bash
- name: Upload Builds
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python -m pip install twine
python -m twine upload --skip-existing wheelhouse/*.whl
shell: bash