@@ -52,48 +52,35 @@ 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+ # fix git permissions
73+ export HOME=${RUNNER_TEMP}
74+ git config --global --add safe.directory '*'
75+ gh release download llvm-22.1.8 --pattern "llvm-linux-$(uname -m).zip"
76+ unzip "llvm-linux-$(uname -m).zip"
77+ rm "llvm-linux-$(uname -m).zip"
9178
9279 - name : Build
9380 run : |
9481 source /opt/rh/gcc-toolset-14/enable
9582 cmake -B build -G Ninja \
96- -D Clang_DIR=llvm-out /lib/cmake/clang \
83+ -D Clang_DIR=llvm/lib/cmake/clang \
9784 -D CMAKE_BUILD_TYPE=Release \
9885 -D MRBIND_STATIC_BUILD=ON \
9986 -D CMAKE_CXX_FLAGS="-ffunction-sections -fdata-sections" \
@@ -107,31 +94,22 @@ jobs:
10794
10895 - name : Test
10996 run : |
110- dnf install -y gcc-c++ findutils python38-devel
111- export CLANG_RESOURCE_DIR="$(pwd)/llvm-out/lib/clang/22"
97+ export CLANG_RESOURCE_DIR="$(pwd)/llvm/lib/clang/22"
11298 source /opt/rh/gcc-toolset-14/enable
11399 echo g++ > examples/cxx.txt
114100 examples/c/run.sh
115101 PYTHON=python3.8 examples/python/run.sh
116102
117103 - name : Create package
118104 run : |
119- dnf install -y zip
120105 mkdir mrbind
121106 mv build/mrbind{,_gen_c,_gen_csharp} mrbind/
122- mv llvm-out /lib/clang/22 mrbind/resource-dir
107+ mv llvm/lib/clang/22 mrbind/resource-dir
123108 zip -r mrbind-linux-$(uname -m).zip mrbind/
124109
125110 - name : Upload package
126111 env :
127112 GH_TOKEN : ${{ github.token }}
128113 VERSION : ${{ needs.create-release.outputs.version }}
129114 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
137115 gh release upload ${VERSION} mrbind-linux-$(uname -m).zip --clobber
0 commit comments