Update android-llvm-msvc-build.yml #9
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: android-llvm-msvc-build | |
on: [push, pull_request] | |
jobs: | |
build: | |
# Skip building pull requests from the same repository | |
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
env: | |
BUILD_TYPE: Release | |
steps: | |
- name: Setup build deps | |
run: | | |
sudo wget -qO /usr/local/bin/ninja.gz https://github.com/ninja-build/ninja/releases/latest/download/ninja-linux.zip \ | |
&& sudo gunzip /usr/local/bin/ninja.gz \ | |
&& sudo chmod a+x /usr/local/bin/ninja \ | |
&& sudo apt-get install build-essential make cmake \ | |
&& sudo apt-get install p7zip-full p7zip-rar | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
with: | |
path: llvm-msvc | |
submodules: 'recursive' | |
- name: Build llvm | |
run: | | |
cmake -G "Ninja" -Bbuild \ | |
-DLLVM_INCLUDE_TESTS=OFF \ | |
-DLLVM_INCLUDE_EXAMPLES=OFF \ | |
-DLLDB_ENABLE_PYTHON=OFF \ | |
-DLLVM_ENABLE_LIBXML2=OFF \ | |
-DLLVM_ENABLE_ZLIB=OFF \ | |
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ | |
-DCPACK_GENERATOR=ZIP \ | |
-DCMAKE_INSTALL_PREFIX=install \ | |
-DLLVM_TARGETS_TO_BUILD="X86;ARM;AArch64" \ | |
-DLLVM_ENABLE_PROJECTS="clang;lld;lldb" \ | |
llvm-msvc/llvm | |
time cmake --build build --config ${{ env.BUILD_TYPE }} | |
sudo cmake --build build --target install | |
- name: Build compiler-rt | |
run: | | |
CC=install/bin/clang CXX=install/bin/clang++ | |
cmake -GNinja -Bcompiler-rt-build compiler-rt \ | |
-DCMAKE_INSTALL_PREFIX=install \ | |
-DCOMPILER_RT_DEFAULT_TARGET_TRIPLE="aarch64-android-android-android" \ | |
-DCOMPILER_RT_DEFAULT_TARGET_ARCH="aarch64" | |
time cmake --build compiler-rt-build --config ${{ env.BUILD_TYPE }} | |
sudo cmake --build compiler-rt-build --target install | |
- name: Package llvm | |
run: | |
7z a android-llvm-msvc.zip install | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: android-llvm-msvc | |
path: android-llvm-msvc.zip | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
with: | |
prerelease: ${{ !startsWith(github.ref, 'refs/tags/v') || contains(github.ref, '-pre') }} | |
files: android-llvm-msvc.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |