FIX Hot fix for llvm-x86_64-pc-windows-gnu.
#12
Workflow file for this run
This file contains hidden or 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: llvm-x86_64-pc-windows-gnu | |
| on: | |
| push: | |
| tags: | |
| - 'llvm-x86_64-pc-windows-gnu-v*.*.*' | |
| jobs: | |
| build-llvm: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: devcheck/x86_64-pc-windows-gnu:latest | |
| permissions: | |
| contents: write | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - name: Generating Unique ID | |
| run: | | |
| BASE_NAME=$(echo "$GITHUB_REF" | sed 's|^refs/tags/||') | |
| BUILD_ID="${BASE_NAME}-$GITHUB_RUN_ID" | |
| echo "BUILD_ID=$BUILD_ID" >> $GITHUB_ENV | |
| echo "BASE_NAME=$BASE_NAME" >> $GITHUB_ENV | |
| echo "Unique ID: $BUILD_ID" | |
| echo "Base name: $BASE_NAME" | |
| - name: Installing dependencies | |
| run: | | |
| apt-get update | |
| apt-get install -y build-essential cmake ninja-build python3 wget libz-dev binutils xz-utils | |
| apt-get remove -y llvm-14* clang-14* || true | |
| rm -rf /usr/lib/llvm-14 | |
| - name: Downloading LLVM project | |
| run: | | |
| wget https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.6/llvm-project-17.0.6.src.tar.xz | |
| - name: Unpacking LLVM project | |
| run: | | |
| tar -xf llvm-project-17.0.6.src.tar.xz | |
| mv llvm-project-17.0.6.src llvm-project | |
| - name: Creating cross-compilation build directory | |
| run: | | |
| mkdir -p llvm-build | |
| - name: Configure LLVM for cross-compilation | |
| run: | | |
| cmake ../llvm-project/llvm -G Ninja \ | |
| -DCMAKE_BUILD_TYPE=MinSizeRel \ | |
| -DCMAKE_SYSTEM_NAME=Windows \ | |
| -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc-posix \ | |
| -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++-posix \ | |
| -DCMAKE_C_FLAGS="--sysroot=/usr/x86_64-w64-mingw32 -idirafter/usr/include" \ | |
| -DCMAKE_CXX_FLAGS="--sysroot=/usr/x86_64-w64-mingw32 -idirafter/usr/include" \ | |
| -DLLVM_ENABLE_PROJECTS="llvm;lld" \ | |
| -DLLVM_ENABLE_TERMINFO=OFF \ | |
| -DLLVM_ENABLE_ZLIB=ON \ | |
| -DLLVM_ENABLE_LIBXML2=OFF \ | |
| -DCMAKE_INSTALL_PREFIX="dist" \ | |
| -DLLVM_TARGETS_TO_BUILD=all \ | |
| -DLLVM_BUILD_TESTS=OFF \ | |
| -DLLVM_BUILD_EXAMPLES=OFF \ | |
| -DLLVM_INCLUDE_TESTS=OFF \ | |
| -DLLVM_INCLUDE_EXAMPLES=OFF \ | |
| -DLLVM_INCLUDE_DOCS=OFF | |
| working-directory: llvm-build | |
| - name: Building LLVM | |
| run: | | |
| ninja -j$(nproc) | |
| working-directory: llvm-build | |
| - name: Installing LLVM | |
| run: | | |
| ninja install | |
| working-directory: llvm-build | |
| - name: Cleaning LLVM Binaries | |
| run: | | |
| find llvm-build/dist/bin -type f -executable ! -name "llvm-config" -delete | |
| - name: Preparing distribution files | |
| run: | | |
| mkdir -p tempDir/lib | |
| mkdir -p tempDir/bin | |
| mkdir -p tempDir/include | |
| cp -r llvm-build/dist/lib/* tempDir/lib/ | |
| cp -r llvm-build/dist/bin/* tempDir/bin/ | |
| cp -r llvm-build/dist/include/* tempDir/include/ | |
| - name: Packaging LLVM (LLVM Libraries, Binaries & Includes) | |
| run: | | |
| tar --format=pax -cJf llvm-x86_64-pc-windows-gnu.tar.xz --exclude='*/*.cmake' --exclude='*/*.o' --exclude='*/*.d' lib bin include | |
| working-directory: tempDir | |
| - name: Releasing LLVM | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ env.BUILD_ID }} | |
| name: "llvm-x86_64-pc-windows-gnu" | |
| body: | | |
| ## llvm-x86_64-pc-windows-gnu | |
| LLVM for llvm-x86_64-pc-windows-gnu host target for Thrush Compiler build phase. | |
| files: | | |
| tempDir/llvm-x86_64-pc-windows-gnu.tar.xz | |
| draft: false |