Skip to content

Upgrade llvm version to v19.1.3. #172

Upgrade llvm version to v19.1.3.

Upgrade llvm version to v19.1.3. #172

name: libclang-macosx-amd64
on: [push, pull_request]
env:
LLVM_VER: 19.1.3
MACOSX_DEPLOYMENT_TARGET: "10.9"
concurrency:
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
build-and-deploy:
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: macos-11
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: install wheel dependencies
run: |
pip3 install wheel
- name: install gnu-tar
run: |
brew install gnu-tar
- name: get llvm-project
run: |
wget -q https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VER/llvm-project-$LLVM_VER.src.tar.xz
tar xf llvm-project-$LLVM_VER.src.tar.xz
mv llvm-project-$LLVM_VER.src llvm-project-$LLVM_VER
- name: make build directory
run: mkdir -p llvm-project-$LLVM_VER/build
- name: cmake
run: |
cd llvm-project-$LLVM_VER/build
cmake ../llvm \
-DLLVM_ENABLE_PROJECTS=clang \
-DBUILD_SHARED_LIBS=OFF \
-DLLVM_ENABLE_ZLIB=OFF \
-DLLVM_ENABLE_ZSTD=OFF \
-DLLVM_ENABLE_TERMINFO=OFF \
-DLLVM_TARGETS_TO_BUILD=X86 \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-O2 -g -DNDEBUG -static-libgcc -static-libstdc++" \
-DCMAKE_C_COMPILER=gcc-10 \
-DCMAKE_CXX_COMPILER=g++-10 \
-DCMAKE_OSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET
- name: build
run: cd llvm-project-$LLVM_VER/build && make libclang -j$(sysctl -n hw.ncpu)
- name: print dependencies
run: |
du -csh llvm-project-$LLVM_VER/build/lib/libclang.dylib
file llvm-project-$LLVM_VER/build/lib/libclang.dylib
otool -L llvm-project-$LLVM_VER/build/lib/libclang.dylib
dyldinfo -platform -dependents libclang.dylib || true
- name: create and print sha512sum
run: |
cd llvm-project-$LLVM_VER/build/lib
shasum -a512 libclang.dylib > libclang.dylib.$LLVM_VER.macosx-amd64.sha512sum
echo "Checksum is: "
cat libclang.dylib.$LLVM_VER.macosx-amd64.sha512sum
gtar zcvf libclang.dylib.$LLVM_VER.macosx-amd64.tar.gz libclang.dylib libclang.dylib.$LLVM_VER.macosx-amd64.sha512sum
shasum -a512 libclang.dylib.$LLVM_VER.macosx-amd64.tar.gz
- uses: actions/upload-artifact@v4
with:
name: libclang.dylib.${{env.LLVM_VER}}.macosx-amd64.tar.gz
path: llvm-project-${{env.LLVM_VER}}/build/lib/libclang.dylib.${{env.LLVM_VER}}.macosx-amd64.tar.gz
- name: generate wheel package
run: |
cp llvm-project-$LLVM_VER/build/lib/libclang.dylib native/
python3 setup_ext.py bdist_wheel --universal --plat-name=macosx_10_9_x86_64
- uses: actions/upload-artifact@v4
with:
name: wheel-${{env.LLVM_VER}}-macosx_10_9_x86_64
path: dist/*.whl
upload-to-pypi:
runs-on: ubuntu-latest
needs: [build-and-deploy]
steps:
- uses: actions/download-artifact@v4
with:
name: wheel-${{env.LLVM_VER}}-macosx_10_9_x86_64
path: dist/
- name: Publish to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages_dir: dist/
password: ${{ secrets.PYPI_TOKEN }}
verbose: true
print_hash: true