Fixes CI for macos arm64 runner (migrate to the github M1 runner). (#72) #171
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: libclang-windows-amd64 | |
on: [push, pull_request] | |
env: | |
LLVM_VER: 18.1.1 | |
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: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: install wheel dependencies | |
run: | | |
pip3 install wheel | |
- name: get llvm-project | |
run: | | |
choco install wget git | |
git clone https://github.com/llvm/llvm-project.git llvm-project-$env:LLVM_VER -b llvmorg-$env:LLVM_VER --depth=1 | |
- name: make build directory | |
run: mkdir -p llvm-project-$env:LLVM_VER/build | |
- name: cmake | |
run: | | |
cd llvm-project-$env:LLVM_VER/build | |
cmake ../llvm ` | |
-Thost=x64 ` | |
-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_CXX_FLAGS="/MP" ` | |
-DLLVM_USE_CRT_MINSIZEREL="MT" | |
- name: build | |
run: cd llvm-project-$env:LLVM_VER/build && cmake --build . --config RelWithDebInfo --target libclang | |
- name: create and print sha512sum | |
run: | | |
$env:Path = "C:\Program Files\Git\usr\bin;$env:Path" | |
cd llvm-project-$env:LLVM_VER\build\RelWithDebInfo\bin | |
sha512sum.exe libclang.dll > libclang.dll.$env:LLVM_VER.windows-amd64.sha512sum | |
echo "Checksum is: " | |
Get-Content -Path libclang.dll.$env:LLVM_VER.windows-amd64.sha512sum | |
tar zcvf libclang.dll.$env:LLVM_VER.windows-amd64.tar.gz libclang.dll libclang.dll.$env:LLVM_VER.windows-amd64.sha512sum | |
sha512sum.exe libclang.dll.$env:LLVM_VER.windows-amd64.tar.gz | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: libclang.dll.${{env.LLVM_VER}}.windows-amd64.tar.gz | |
path: llvm-project-${{env.LLVM_VER}}\build\RelWithDebInfo\bin\libclang.dll.${{env.LLVM_VER}}.windows-amd64.tar.gz | |
- name: generate wheel package | |
run: | | |
cp llvm-project-${{env.LLVM_VER}}\build\RelWithDebInfo\bin\libclang.dll native/ | |
python3 setup_ext.py bdist_wheel --universal --plat-name=win_amd64 | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: wheel-${{env.LLVM_VER}}-win_amd64 | |
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}}-win_amd64 | |
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 |