Skip to content

Commit 5a86dee

Browse files
committed
Use prebuilt LLVM
1 parent 86ebe4f commit 5a86dee

1 file changed

Lines changed: 13 additions & 38 deletions

File tree

.github/workflows/build-release.yml

Lines changed: 13 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -52,48 +52,32 @@ jobs:
5252
- name: Install tools
5353
run: |
5454
dnf install -y epel-release
55+
dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo
5556
dnf install -y --enablerepo powertools \
5657
gcc-toolset-14 cmake ninja-build \
5758
$(: CI requirements ) \
58-
git \
59-
$(: LLVM build requirements ) \
60-
python3 xz
59+
git gh unzip zip \
60+
$(: test requirements ) \
61+
gcc-c++ findutils python38-devel
6162
6263
- name: Checkout
6364
uses: actions/checkout@v6
6465
with:
6566
submodules: true
6667

67-
- name: Restore LLVM cache
68-
id: llvm-cache
69-
uses: actions/cache/restore@v5
70-
with:
71-
key: linux-${{ matrix.arch }}-llvm_22_1_8-v2
72-
path: llvm-out
73-
74-
- name: Download LLVM
75-
if: steps.llvm-cache.outputs.cache-hit != 'true'
76-
run: |
77-
ci/download_llvm.sh 22.1.8
78-
79-
- name: Build libclang
80-
if: steps.llvm-cache.outputs.cache-hit != 'true'
68+
- name: Download and unpack LLVM
69+
env:
70+
GH_TOKEN: ${{ github.token }}
8171
run: |
82-
source /opt/rh/gcc-toolset-14/enable
83-
ci/build_llvm.sh
84-
85-
- name: Save LLVM cache
86-
if: steps.llvm-cache.outputs.cache-hit != 'true'
87-
uses: actions/cache/save@v5
88-
with:
89-
key: linux-${{ matrix.arch }}-llvm_22_1_8-v2
90-
path: llvm-out
72+
gh release download llvm-22.1.8 --pattern "llvm-linux-$(uname -m).zip"
73+
unzip "llvm-linux-$(uname -m).zip"
74+
rm "llvm-linux-$(uname -m).zip"
9175
9276
- name: Build
9377
run: |
9478
source /opt/rh/gcc-toolset-14/enable
9579
cmake -B build -G Ninja \
96-
-D Clang_DIR=llvm-out/lib/cmake/clang \
80+
-D Clang_DIR=llvm/lib/cmake/clang \
9781
-D CMAKE_BUILD_TYPE=Release \
9882
-D MRBIND_STATIC_BUILD=ON \
9983
-D CMAKE_CXX_FLAGS="-ffunction-sections -fdata-sections" \
@@ -107,31 +91,22 @@ jobs:
10791
10892
- name: Test
10993
run: |
110-
dnf install -y gcc-c++ findutils python38-devel
111-
export CLANG_RESOURCE_DIR="$(pwd)/llvm-out/lib/clang/22"
94+
export CLANG_RESOURCE_DIR="$(pwd)/llvm/lib/clang/22"
11295
source /opt/rh/gcc-toolset-14/enable
11396
echo g++ > examples/cxx.txt
11497
examples/c/run.sh
11598
PYTHON=python3.8 examples/python/run.sh
11699
117100
- name: Create package
118101
run: |
119-
dnf install -y zip
120102
mkdir mrbind
121103
mv build/mrbind{,_gen_c,_gen_csharp} mrbind/
122-
mv llvm-out/lib/clang/22 mrbind/resource-dir
104+
mv llvm/lib/clang/22 mrbind/resource-dir
123105
zip -r mrbind-linux-$(uname -m).zip mrbind/
124106
125107
- name: Upload package
126108
env:
127109
GH_TOKEN: ${{ github.token }}
128110
VERSION: ${{ needs.create-release.outputs.version }}
129111
run: |
130-
# TODO: use a ready-made universal GitHub action
131-
dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo
132-
dnf install -y gh
133-
# fix git permissions
134-
export HOME=${RUNNER_TEMP}
135-
git config --global --add safe.directory '*'
136-
# upload package
137112
gh release upload ${VERSION} mrbind-linux-$(uname -m).zip --clobber

0 commit comments

Comments
 (0)