44 workflow_dispatch :
55
66jobs :
7+ create-release :
8+ runs-on : ubuntu-slim
9+
10+ outputs :
11+ version : ${{ steps.get-version.outputs.version }}
12+
13+ steps :
14+ - name : Checkout
15+ uses : actions/checkout@v6
16+ with :
17+ # fetch full history + tags
18+ fetch-depth : 0
19+
20+ - name : Get version
21+ id : get-version
22+ run : |
23+ VERSION=$(ci/git_version.sh | xargs)
24+ echo "version=${VERSION}" >> $GITHUB_OUTPUT
25+
26+ - name : Create release
27+ env :
28+ GH_TOKEN : ${{ github.token }}
29+ VERSION : ${{ steps.get-version.outputs.version }}
30+ run : |
31+ gh release create ${VERSION} \
32+ --draft \
33+ --title "mrbind ${VERSION}"
34+
735 build-linux :
36+ needs :
37+ - create-release
838 runs-on : ${{ matrix.runner }}
939 container :
10- image : rockylinux :8
40+ image : almalinux :8
1141 strategy :
1242 fail-fast : false
1343 matrix :
@@ -19,33 +49,68 @@ jobs:
1949 runner : ubuntu-24.04-arm
2050
2151 steps :
22- - name : Checkout
23- uses : action/checkout@v6
24-
25- - name : Install build tools
52+ - name : Install tools
2653 run : |
2754 dnf install -y epel-release
55+ dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo
2856 dnf install -y --enablerepo powertools \
29- gcc-toolset-14 cmake ninja-build python3
57+ gcc-toolset-14 cmake ninja-build \
58+ $(: CI requirements ) \
59+ git gh unzip zip \
60+ $(: test requirements ) \
61+ gcc-c++ findutils python38-devel
3062
31- - name : Download LLVM
63+ - name : Checkout
64+ uses : actions/checkout@v6
65+ with :
66+ submodules : true
67+
68+ - name : Fix git permissions
3269 run : |
33- ci/download_llvm.sh 22.1.8
70+ git config --global --add safe.directory '*'
3471
35- - name : Build libclang
72+ - name : Download and unpack LLVM
73+ env :
74+ GH_TOKEN : ${{ github.token }}
3675 run : |
37- source /opt/rh/gcc-toolset-14/enable
38- ci/build_llvm.sh
76+ gh release download llvm-22.1.8 --pattern "llvm-linux-$(uname -m).zip"
77+ unzip "llvm-linux-$(uname -m).zip"
78+ rm "llvm-linux-$(uname -m).zip"
3979
4080 - name : Build
4181 run : |
4282 source /opt/rh/gcc-toolset-14/enable
4383 cmake -B build -G Ninja \
44- -D Clang_DIR=llvm-out/lib/cmake/clang \
45- -D CMAKE_BUILD_TYPE=Release
84+ -D Clang_DIR=llvm/lib/cmake/clang \
85+ -D CMAKE_BUILD_TYPE=Release \
86+ -D MRBIND_STATIC_BUILD=ON \
87+ -D CMAKE_CXX_FLAGS="-ffunction-sections -fdata-sections" \
88+ -D CMAKE_EXE_LINKER_FLAGS="-Wl,--gc-sections -Wl,-s"
4689 cmake --build build --parallel $(nproc)
4790
48- - name : Verify build
91+ - name : Verify binaries
4992 run : |
93+ ls -l build/mrbind*
5094 ldd build/mrbind*
51- build/mrbind --help
95+
96+ - name : Test
97+ run : |
98+ export CLANG_RESOURCE_DIR="$(pwd)/llvm/lib/clang/22"
99+ source /opt/rh/gcc-toolset-14/enable
100+ echo g++ > examples/cxx.txt
101+ examples/c/run.sh
102+ PYTHON=python3.8 examples/python/run.sh
103+
104+ - name : Create package
105+ run : |
106+ mkdir mrbind
107+ mv build/mrbind{,_gen_c,_gen_csharp} mrbind/
108+ mv llvm/lib/clang/22 mrbind/resource-dir
109+ zip -r mrbind-linux-$(uname -m).zip mrbind/
110+
111+ - name : Upload package
112+ env :
113+ GH_TOKEN : ${{ github.token }}
114+ VERSION : ${{ needs.create-release.outputs.version }}
115+ run : |
116+ gh release upload ${VERSION} mrbind-linux-$(uname -m).zip --clobber
0 commit comments