Fixes CI for macos arm64 runner (migrate to the github M1 runner). #87
Workflow file for this run
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-aarch64 | |
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: build host llvm-tblgen/clang-tblgen | |
run: | | |
mkdir llvm-project-$env:LLVM_VER/build-host | |
cd llvm-project-$env:LLVM_VER/build-host | |
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_BUILD_TYPE=RelWithDebInfo ` | |
-DCMAKE_CXX_FLAGS="/MP" ` | |
-DLLVM_USE_CRT_MINSIZEREL="MT" | |
cmake --build . --config RelWithDebInfo --target clang-tblgen | |
cmake --build . --config RelWithDebInfo --target llvm-tblgen | |
cd RelWithDebInfo | |
mkdir C:\llvm | |
cp bin\clang-tblgen.exe C:\llvm | |
cp bin\llvm-tblgen.exe C:\llvm | |
- name: cmake | |
run: | | |
mkdir -p llvm-project-$env:LLVM_VER/build | |
cd llvm-project-$env:LLVM_VER/build | |
cmake ../llvm ` | |
-A ARM64 ` | |
-Thost=x64 ` | |
-DCMAKE_SYSTEM_NAME=Windows ` | |
-DLLVM_ENABLE_PROJECTS=clang ` | |
-DBUILD_SHARED_LIBS=OFF ` | |
-DLLVM_ENABLE_ZLIB=OFF ` | |
-DLLVM_ENABLE_ZSTD=OFF ` | |
-DLLVM_ENABLE_TERMINFO=OFF ` | |
-DLLVM_TARGETS_TO_BUILD=AArch64 ` | |
-DLLVM_TABLEGEN=C:\llvm\llvm-tblgen.exe ` | |
-DCLANG_TABLEGEN=C:\llvm\clang-tblgen.exe ` | |
-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-aarch64.sha512sum | |
echo "Checksum is: " | |
Get-Content -Path libclang.dll.$env:LLVM_VER.windows-aarch64.sha512sum | |
tar zcvf libclang.dll.$env:LLVM_VER.windows-aarch64.tar.gz libclang.dll libclang.dll.$env:LLVM_VER.windows-aarch64.sha512sum | |
sha512sum.exe libclang.dll.$env:LLVM_VER.windows-aarch64.tar.gz | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: libclang.dll.${{env.LLVM_VER}}.windows-aarch64.tar.gz | |
path: llvm-project-${{env.LLVM_VER}}\build\RelWithDebInfo\bin\libclang.dll.${{env.LLVM_VER}}.windows-aarch64.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_arm64 | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: wheel-${{env.LLVM_VER}}-win_arm64 | |
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_arm64 | |
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 |