Skip to content

Commit 83f6d05

Browse files
committed
WIP: setting up mac build
1 parent f694570 commit 83f6d05

File tree

2 files changed

+58
-39
lines changed

2 files changed

+58
-39
lines changed

.github/workflows/build-llvm.yaml

+37-35
Original file line numberDiff line numberDiff line change
@@ -14,48 +14,50 @@ jobs:
1414
strategy:
1515
matrix:
1616
# os: [ubuntu-20.04, macos-11, windows-2019]
17-
os: [ubuntu-20.04]
17+
os: [ubuntu-20.04, macos-11]
1818
runs-on: ${{ matrix.os }}
19-
permissions:
20-
contents: write # for creating releases
21-
container:
22-
# Intentionally old ubuntu version with old glibc.
23-
image: ubuntu:18.04
19+
# container:
20+
# # Intentionally old ubuntu version with old glibc.
21+
# image: ubuntu:18.04
2422
steps:
2523
- name: checkout
2624
uses: actions/checkout@v3
2725

2826
# Install build dependencies.
29-
- run: "apt update && apt install -y clang git wget build-essential python3 unzip"
30-
# cmake from package manager is to old for the LLVM build.
31-
- run: "wget https://github.com/Kitware/CMake/releases/download/v3.30.0-rc2/cmake-3.30.0-rc2-linux-x86_64.sh"
32-
- run: "chmod +x cmake-*.sh"
33-
- run: "./cmake-*.sh --skip-license --prefix=/usr"
34-
# ninja from the package manager is to old for the LLVM build.
35-
- run: "wget https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-linux.zip"
36-
- run: "unzip ninja-linux.zip -d /usr/bin/"
27+
# - if: contains(matrix.os, 'ubuntu')
28+
# run: |
29+
# apt update && apt install -y clang git wget build-essential python3 unzip
30+
# # cmake from package manager is to old for the LLVM build.
31+
# wget https://github.com/Kitware/CMake/releases/download/v3.30.0-rc2/cmake-3.30.0-rc2-linux-x86_64.sh
32+
# chmod +x cmake-*.sh
33+
# ./cmake-*.sh --skip-license --prefix=/usr
34+
# # ninja from the package manager is to old for the LLVM build.
35+
# wget https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-linux.zip
36+
# unzip ninja-linux.zip -d /usr/bin/
3737
# Build and package LLVM.
38-
- run: "./build-llvm-libs.sh"
39-
- uses: actions/upload-artifact@v3
38+
- run: "./build-llvm-libs.sh llvm-static-libs-${{ matrix.os }}.tar.gz"
39+
- uses: actions/upload-artifact@v4
4040
with:
41-
name: llvm-static-libs
42-
path: llvm-static-libs.tar.gz
43-
- name: create release
44-
id: create-release
45-
uses: actions/create-release@v1
46-
env:
47-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
name: llvm-static-libs-${{ matrix.os }}
42+
path: llvm-static-libs-${{ matrix.os }}.tar.gz
43+
44+
create_release:
45+
name: Create release
46+
runs-on: ubuntu-latest
47+
needs: [build_llvm]
48+
permissions:
49+
contents: write # for creating releases
50+
steps:
51+
- name: Download Artifacts
52+
uses: actions/download-artifact@v4
4853
with:
49-
tag_name: ${{ inputs.tag }}
50-
release_name: ${{ inputs.tag }}
51-
draft: false
52-
prerelease: true
53-
- name: upload linux artifact
54-
uses: actions/upload-release-asset@v1
55-
env:
56-
GITHUB_TOKEN: ${{ github.token }}
54+
pattern: llvm-static-libs-*
55+
merge-multiple: true
56+
57+
- name: Create Release
58+
uses: softprops/action-gh-release@v2
5759
with:
58-
upload_url: ${{ steps.create-release.outputs.upload_url }}
59-
asset_path: ./llvm-static-libs.tar.xz
60-
asset_name: llvm-static-linux-amd64.tar.xz
61-
asset_content_type: application/gzip
60+
name: LLVM tooling libraries ${{ inputs.tag }}
61+
tag_name: ${{ inputs.tag }}
62+
files: llvm-static-libs-*
63+
fail_on_unmatched_files: true

build-llvm-libs.sh

+21-4
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,31 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
44
BUILD_DIR="$SCRIPT_DIR/build"
55
LLVM_BUILD_DIR="$BUILD_DIR/external.llvm-project"
66

7+
OUTPUT_FILE=llvm-static-libs.tar.xz
8+
if [ "$#" -eq 1 ]
9+
then
10+
OUTPUT_FILE=$1
11+
fi
12+
13+
CC=clang
14+
CXX=clang++
15+
716
cd "$SCRIPT_DIR"
8-
mkdir -p build
9-
cmake -B build -GNinja .
10-
cmake --build build
17+
mkdir -p $BUILD_DIR
18+
19+
# DEBUG:
20+
# cmake -B build -GNinja .
21+
# cmake --build build
22+
23+
mkdir -p $LLVM_BUILD_DIR/include
24+
touch $LLVM_BUILD_DIR/include/clang.h
25+
mkdir -p $LLVM_BUILD_DIR/lib
26+
touch $LLVM_BUILD_DIR/lib/libclang.a
27+
1128

1229
# Pack everything we need into a tar archive.
1330
# We only need the header files, static libraries and add
1431
# a CMake file that makes it easy to link libclangTooling.
1532
cp $SCRIPT_DIR/cmake/CMakeLists.txt $LLVM_BUILD_DIR
1633
cd $LLVM_BUILD_DIR
17-
tar -czvf "$SCRIPT_DIR/llvm-static-libs.tar.xz" include/ lib/*.a CMakeLists.txt
34+
tar -czvf "$SCRIPT_DIR/$OUTPUT_FILE" include/ lib/*.a CMakeLists.txt

0 commit comments

Comments
 (0)