Merge pull request #33 from ZhymabekRoman/pypi #1
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: Publish to PyPI | |
on: | |
push: | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-20.04, windows-2019, macos-11] | |
env: | |
CIBW_BEFORE_ALL_LINUX: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable -y" | |
CIBW_BUILD_VERBOSITY: "1" | |
CIBW_SKIP: cp39-musllinux_i686 cp310-musllinux_i686 cp311-musllinux_i686 cp312-musllinux_i686 # Can't install Rust on musl based Linux systems | |
CIBW_ENVIRONMENT: 'PATH="$PATH:$HOME/.cargo/bin"' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up QEMU | |
if: runner.os == 'Linux' | |
uses: docker/setup-qemu-action@v1 | |
with: | |
platforms: all | |
- name: Build wheels | |
uses: pypa/[email protected] | |
with: | |
package-dir: ./python | |
output-dir: ./python/wheelhouse | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: wheel-${{ runner.os }} | |
path: ./python/wheelhouse/*.whl | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
profile: minimal | |
- uses: actions/setup-python@v2 | |
name: Install Python | |
with: | |
python-version: "3.9" | |
- name: Build sdist | |
run: | | |
python -m pip install setuptools-rust setuptools wheel | |
cd python/ | |
python setup.py sdist | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: sdist-${{ runner.os }} | |
path: python/dist/*.tar.gz | |
# release: | |
# needs: [build_wheels, build_sdist] | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/download-artifact@v2 | |
# with: | |
# name: artifact | |
# path: python/dist | |
# - uses: pypa/gh-action-pypi-publish@release/v1 | |
# with: | |
# packages-dir: python/dist/ | |
# user: __token__ | |
# password: ${{ secrets.PYPI_API_TOKEN }} |