Merge pull request #263 from xinhuitian/fix-gpt-example #12
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: Build ARM64 | |
on: | |
workflow_dispatch: | |
inputs: | |
TAG_NAME: | |
description: 'Release Version Tag' | |
required: true | |
release: | |
types: [created] | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- '**/*.md' | |
defaults: | |
run: | |
shell: bash -leo pipefail {0} | |
jobs: | |
build_wheels_linux_arm64: | |
name: ${{ matrix.os }} py${{ matrix.python-version }} | |
runs-on: | |
- self-hosted | |
- ARM64 | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-22.04 ] | |
env: | |
RUNNER_OS: ${{ matrix.os }} | |
PYTHON_VERSIONS: "3.8 3.9 3.10 3.11 3.12" | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Restore submodules cache | |
run: | | |
cp -a /builder_cache/contrib ./ | |
- name: remove old clang and link clang-18 to clang | |
if: matrix.os == 'ubuntu-22.04' | |
run: | | |
sudo rm -f /usr/bin/clang || true | |
sudo ln -s /usr/bin/clang-18 /usr/bin/clang | |
sudo rm -f /usr/bin/clang++ || true | |
sudo ln -s /usr/bin/clang++-18 /usr/bin/clang++ | |
which clang++ | |
clang++ --version | |
- name: Make linux-arm64 | |
run: | | |
bash -l -e chdb/build_linux_arm64.sh | |
continue-on-error: false | |
- name: Show libchdb | |
run: | | |
ls -lh | |
nm libchdb.so | grep query_stable || true | |
- name: Run libchdb stub in examples dir | |
run: | | |
bash -x ./examples/runStub.sh | |
- name: Check ccache statistics | |
run: | | |
ccache -s | |
ls -lh chdb | |
df -h | |
- name: Audit wheels | |
run: | | |
export PYENV_ROOT="$HOME/.pyenv" | |
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH" | |
eval "$(pyenv init -)" | |
pyenv local "${{ matrix.python-version }}" | |
python3 -m pip install auditwheel | |
auditwheel -v repair -w dist/ --plat manylinux_2_17_aarch64 dist/*.whl | |
continue-on-error: false | |
- name: Show files | |
run: | | |
# e.g: remove chdb-0.11.4-cp310-cp310-linux_aarch64.whl, keep chdb-0.11.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | |
sudo rm -f dist/*linux_aarch64.whl | |
ls -lh dist | |
shell: bash | |
continue-on-error: false | |
- name: Upload wheels to release | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
gh release upload ${{ github.ref_name }} dist/*.whl --clobber | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
- name: Upload libchdb.so to release | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
cp programs/local/chdb.h chdb.h | |
tar -czvf linux-aarch64-libchdb.tar.gz libchdb.so chdb.h | |
gh release upload ${{ github.ref_name }} linux-aarch64-libchdb.tar.gz --clobber | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: | | |
./dist/*.whl | |
./linux-aarch64-libchdb.tar.gz | |
- name: Upload pypi | |
if: ${{ startsWith(github.ref, 'refs/tags/v') || startsWIth(github.event.inputs.TAG_NAME, 'v') }} | |
run: | | |
export PYENV_ROOT="$HOME/.pyenv" | |
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH" | |
eval "$(pyenv init -)" | |
pyenv local "${{ matrix.python-version }}" | |
python3 -m pip install twine | |
python3 -m twine upload ./dist/*.whl | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |