Skip to content

Enh/cython

Enh/cython #353

Workflow file for this run

name: taos-ws-py
on:
push:
branches:
- main
tags:
- taos-ws-py-v*
pull_request:
branches:
- main
env:
PYTHON_VERSION: "3.7" # to build abi3 wheels
jobs:
rebuild:
runs-on: ubuntu-latest
outputs:
status: ${{ steps.output.outputs.rebuild }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check if file changes would trigger a rebuild
if: "!startsWith(github.ref, 'refs/tags/taos-ws-py')"
id: rebuild
uses: tj-actions/changed-files@v35
with:
files: |
.github/workflows/taos-ws-py.yml
taos-ws-py/**
- name: Set Github Output
if: "!startsWith(github.ref, 'refs/tags/taos-ws-py')"
run: |
echo "rebuild=${{ steps.rebuild.outputs.any_changed }}" >> $GITHUB_ENV
- name: Set Github Output
if: "startsWith(github.ref, 'refs/tags/taos-ws-py')"
run: |
echo "rebuild=true" >> $GITHUB_ENV
- id: output
run: echo "rebuild=${{ env.rebuild }}" >> $GITHUB_OUTPUT
macos:
runs-on: macos-latest
needs: rebuild
if: needs.rebuild.outputs.status == 'true'
strategy:
matrix:
target: [x86_64]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
architecture: x64
- uses: dtolnay/rust-toolchain@stable
- name: Build wheels - x86_64
uses: PyO3/maturin-action@v1
with:
target: x86_64
working-directory: taos-ws-py
args: --release --strip
- name: Install built wheel - x86_64
run: |
pip install taos-ws-py --no-index --force-reinstall --find-links taos-ws-py/target/wheels
- name: Build wheels - universal2
uses: PyO3/maturin-action@v1
with:
working-directory: taos-ws-py
args: --release --strip --target universal2-apple-darwin
- name: Install built wheel - universal2
run: |
pip install taos-ws-py --no-index --force-reinstall --find-links taos-ws-py/target/wheels
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: taos-ws-py
path: taos-ws-py/target/wheels/**
windows:
runs-on: windows-latest
needs: rebuild
if: needs.rebuild.outputs.status == 'true'
strategy:
matrix:
target: [x64] #, x86
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
architecture: ${{ matrix.target }}
- uses: dtolnay/rust-toolchain@stable
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
working-directory: taos-ws-py
args: --release --strip
- name: Install built wheel
run: |
pip install taos-ws-py --no-index --force-reinstall --find-links .\taos-ws-py\target\wheels
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: taos-ws-py
path: taos-ws-py/target/wheels/**
linux:
runs-on: ubuntu-latest
needs: rebuild
if: needs.rebuild.outputs.status == 'true'
strategy:
matrix:
target: [x86_64]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
architecture: x64
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
rust-toolchain: stable
target: ${{ matrix.target }}
working-directory: taos-ws-py
manylinux: auto
args: --release --strip
- name: Install built wheel
run: |
pip install taos-ws-py --no-index --force-reinstall --find-links taos-ws-py/target/wheels
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: taos-ws-py
path: taos-ws-py/target/wheels/**
linux-cross:
runs-on: ubuntu-latest
needs: rebuild
if: needs.rebuild.outputs.status == 'true'
strategy:
matrix:
target: [aarch64, armv7]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Build wheels
uses: messense/maturin-action@v1
with:
target: ${{ matrix.target }}
rust-toolchain: stable
working-directory: taos-ws-py
manylinux: auto
args: --release --strip
- uses: uraimo/[email protected]
name: Install built wheel
with:
arch: ${{ matrix.target }}
distro: ubuntu20.04
githubToken: ${{ github.token }}
install: |
apt-get update
apt-get install -y --no-install-recommends python3 python3-pip
pip3 install -U pip
run: |
pip3 install taos-ws-py --no-index --find-links taos-ws-py/target/wheels/ --force-reinstall
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: taos-ws-py
path: taos-ws-py/target/wheels/**
release:
name: Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/taos-ws-py')"
needs: [macos, windows, linux, linux-cross]
steps:
- uses: actions/download-artifact@v3
with:
name: taos-ws-py
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Publish to PyPI
env:
MATURIN_USERNAME: ${{ secrets.MATURIN_USERNAME }}
MATURIN_PASSWORD: ${{ secrets.MATURIN_PASSWORD }}
uses: PyO3/maturin-action@v1
with:
command: upload
args: --skip-existing *