-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
315 additions
and
61 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
name: Build | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build_sdist: | ||
name: Build SDist | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Build SDist | ||
run: pipx run build --sdist | ||
|
||
- name: Check metadata | ||
run: pipx run twine check dist/* | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: dist-sdist | ||
path: dist/*.tar.gz | ||
|
||
build_wheels: | ||
name: Build wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
# macos-13 is an intel runner, macos-14 is apple silicon | ||
os: [ubuntu-latest, macos-14, windows-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
# see https://github.com/llvm/llvm-project/issues/86250#issuecomment-2219995275 | ||
- name: install DIA SDK | ||
if: runner.os == 'Windows' | ||
shell: bash | ||
run: | | ||
set -x | ||
mkdir -p "C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional" || true | ||
cp -rv "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/DIA SDK" "C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/DIA SDK" | ||
# - name: Set up QEMU | ||
# if: runner.os == 'Linux' | ||
# uses: docker/setup-qemu-action@v3 | ||
# with: | ||
# platforms: all | ||
|
||
- name: Build wheels | ||
uses: pypa/cibuildwheel@v2.19.2 | ||
|
||
- name: Upload wheels artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: dist-${{ matrix.os }} | ||
path: ./wheelhouse/*.whl | ||
|
||
|
||
pypi-publish: | ||
name: Upload to PyPI | ||
needs: [build_wheels, build_sdist] | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/llvmpym | ||
permissions: | ||
id-token: write | ||
|
||
steps: | ||
- uses: actions/setup-python@v5 | ||
|
||
- uses: actions/download-artifact@v4 | ||
with: | ||
pattern: dist-* | ||
path: dist | ||
merge-multiple: true | ||
|
||
- name: Display structure of downloaded files | ||
run: ls -R ./dist | ||
|
||
- name: Publish package distributions to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
/dist | ||
/build | ||
/llvm-build | ||
/wheelhouse | ||
|
||
/pyrightconfig.json | ||
|
||
|
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
sys="$(uname -o)" | ||
arch="$(uname -m)" | ||
|
||
|
||
# Linux | ||
if [[ "$sys" == "GNU/Linux" ]]; then | ||
|
||
if [[ "$arch" == "x86_64" ]]; then | ||
url="https://github.com/llvm/llvm-project/releases/download/llvmorg-18.1.8/clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04.tar.xz" | ||
root_llvm_dir_name="clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04" | ||
|
||
elif [[ "$arch" == "aarch64" ]]; then | ||
url="https://github.com/llvm/llvm-project/releases/download/llvmorg-18.1.8/clang+llvm-18.1.8-aarch64-linux-gnu.tar.xz" | ||
root_llvm_dir_name="clang+llvm-18.1.8-aarch64-linux-gnu.tar.xz" | ||
fi | ||
|
||
# install libraries | ||
DISTRO_NMAE=$(awk -F= '$1=="NAME" { print $2 ;}' /etc/os-release) | ||
if [[ "$DISTRO_NMAE" == "\"AlmaLinux\"" ]]; then | ||
dnf install -y ncurses-devel # Terminfo::terminfo required by LLVM | ||
fi | ||
|
||
|
||
# Windows | ||
elif [[ "$sys" == "Msys" ]]; then | ||
url="https://github.com/llvm/llvm-project/releases/download/llvmorg-18.1.8/clang+llvm-18.1.8-x86_64-pc-windows-msvc.tar.xz" | ||
root_llvm_dir_name="clang+llvm-18.1.8-x86_64-pc-windows-msvc" | ||
|
||
# install libraries | ||
# vcpkg install zlib | ||
|
||
# MacOS | ||
elif [[ "$sys" == "Darwin" ]]; then # Mac (only for 14 or later, i.e. apple silicon) | ||
# install library | ||
brew install llvm@18 | ||
exit | ||
fi | ||
|
||
|
||
# Linux & Windows | ||
curl -L -o ./llvm-build.tar.xz "$url" | ||
tar -xf ./llvm-build.tar.xz | ||
mv "$root_llvm_dir_name" ./llvm-build | ||
|
Oops, something went wrong.