Skip to content

release

release #10

Workflow file for this run

name: CI
on:
push:
branches:
- main
- master
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: read
jobs:
check-rust:
runs-on: ubuntu-latest
steps:
- name: Check Rust Compiler and Cargo
run: |
rustc --version
cargo --version
build-and-test:
needs: check-rust
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: ubuntu-latest
target: x86_64
- runner: ubuntu-latest
target: x86
- runner: ubuntu-latest
target: aarch64
- runner: ubuntu-latest
target: armv7
- runner: ubuntu-latest
target: s390x
- runner: ubuntu-latest
target: ppc64le
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Build and test
run: |
python -m pip install --upgrade pip setuptools setuptools_rust wheel
python setup.py bdist_wheel
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ runner.os }}-${{ matrix.platform.target }}
path: dist/*.whl
sdist:
needs: check-rust
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Build source distribution
run: |
python -m pip install --upgrade pip setuptools setuptools_rust wheel
python setup.py sdist
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: source-dist
path: dist/*.tar.gz
release:
name: Release
needs: build-and-test
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v4
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}