fix/td-32595: bind2 support timezone setting #612
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: taos-ws-py | |
on: | |
push: | |
branches: | |
- main | |
- '3.0' | |
tags: | |
- taos-ws-py-v* | |
pull_request: | |
branches: | |
- main | |
- '3.0' | |
env: | |
PYTHON_VERSION: "3.10" # 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@v41 | |
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-12 | |
needs: rebuild | |
if: needs.rebuild.outputs.status == 'true' | |
strategy: | |
matrix: | |
target: [x86_64] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v5 | |
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 Homebrew | |
run: | | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
- name: Install gettext | |
run: | | |
brew install gettext | |
- name: Set DYLD_LIBRARY_PATH | |
run: | | |
echo "export DYLD_LIBRARY_PATH=/usr/local/opt/gettext/lib:$DYLD_LIBRARY_PATH" >> $GITHUB_ENV | |
- 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@v5 | |
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@v5 | |
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@v5 | |
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/run-on-arch-action@v2.0.5 | |
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@v5 | |
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 * |