Merge pull request #11 from mdmmn378/develop #29
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: CI | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build_and_test: | |
name: Release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release | |
macos: | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: x64 | |
- uses: dtolnay/rust-toolchain@stable | |
- name: Build wheels - universal2 | |
uses: PyO3/maturin-action@v1 | |
with: | |
args: --release --out dist -m Cargo.toml -i ${{ matrix.python-version }} | |
- name: Install built wheel - universal2 | |
run: | | |
pip install texy --no-index --find-links dist --force-reinstall | |
python -c "import texy" | |
- name: Upload wheels | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: dist | |
linux: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
target: [x86_64] | |
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: x64 | |
- name: Build source wheels | |
uses: PyO3/maturin-action@v1 | |
with: | |
target: ${{ matrix.target }} | |
manylinux: auto | |
args: --release --out dist --sdist -m Cargo.toml -i ${{ matrix.python-version }} | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
with: | |
target: ${{ matrix.target }} | |
manylinux: auto | |
args: --release --out dist -m Cargo.toml -i ${{ matrix.python-version }} | |
- name: Install built wheel | |
if: matrix.target == 'x86_64' | |
run: | | |
pip install texy --no-index --find-links dist --force-reinstall | |
python -c "import texy" | |
- name: Upload wheels | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: dist | |
musllinux: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
target: | |
- x86_64-unknown-linux-musl | |
python-version: ["3.7", "3.8", "3.9"] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: x64 | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
with: | |
target: ${{ matrix.target }} | |
manylinux: musllinux_1_2 | |
args: --release --out dist -m Cargo.toml -i ${{ matrix.python-version }} | |
- name: Install built wheel | |
if: matrix.target == 'x86_64-unknown-linux-musl' | |
uses: addnab/docker-run-action@v3 | |
with: | |
image: alpine:latest | |
options: -v ${{ github.workspace }}:/io -w /io | |
run: | | |
apk add py3-pip | |
pip3 install -U pip | |
pip3 install texy --no-index --find-links /io/dist/ --force-reinstall | |
python3 -c "import texy" | |
- name: Upload wheels | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: dist | |
musllinux-cross: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
platform: | |
- target: aarch64-unknown-linux-musl | |
arch: aarch64 | |
- target: armv7-unknown-linux-musleabihf | |
arch: armv7 | |
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
with: | |
target: ${{ matrix.platform.target }} | |
manylinux: musllinux_1_2 | |
args: --release --out dist -m Cargo.toml -i ${{ matrix.python-version }} | |
- uses: uraimo/run-on-arch-action@v2.5.0 | |
name: Install built wheel | |
with: | |
arch: ${{ matrix.platform.arch }} | |
distro: alpine_latest | |
githubToken: ${{ github.token }} | |
install: | | |
apk add py3-pip | |
pip3 install -U pip | |
run: | | |
pip3 install texy --no-index --find-links dist/ --force-reinstall | |
python3 -c "import texy" | |
- name: Upload wheels | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: dist | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
# if: "startsWith(github.ref, 'refs/tags/')" | |
# needs: [macos, linux, musllinux, musllinux-cross] | |
needs: [linux, musllinux, musllinux-cross] | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: wheels | |
- name: Publish to PyPI | |
env: | |
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_PASSWORD }} | |
uses: PyO3/maturin-action@v1 | |
with: | |
command: upload | |
args: --skip-existing * |