Skip to content

Update CI config

Update CI config #40

Workflow file for this run

name: Build Release

Check failure on line 1 in .github/workflows/build-release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/build-release.yml

Invalid workflow file

(Line: 124, Col: 15): A sequence was not expected, (Line: 125, Col: 7): Unexpected value 'include'
on:
workflow_dispatch:
jobs:
create-release:
runs-on: ubuntu-slim
outputs:
version: ${{ steps.get-version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
# fetch full history + tags
fetch-depth: 0
- name: Get version
id: get-version
run: |
VERSION=$(ci/git_version.sh | xargs)
echo "version=${VERSION}" >> $GITHUB_OUTPUT
- name: Create release
env:
GH_TOKEN: ${{ github.token }}
VERSION: ${{ steps.get-version.outputs.version }}
run: |
gh release create ${VERSION} \
--draft \
--title "mrbind ${VERSION}"
build-linux:
needs:
- create-release
runs-on: ${{ matrix.runner }}
container:
image: almalinux:8
strategy:
fail-fast: false
matrix:
arch: [x64, arm64]
include:
- arch: x64
runner: ubuntu-24.04
- arch: arm64
runner: ubuntu-24.04-arm
steps:
- name: Install tools
run: |
dnf install -y epel-release
dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo
dnf install -y --enablerepo powertools \
gcc-toolset-14 cmake ninja-build \
$(: CI requirements ) \
git gh unzip zip \
$(: test requirements ) \
gcc-c++ findutils python38-devel
- name: Checkout
uses: actions/checkout@v6
with:
submodules: true
- name: Fix git permissions
run: |
git config --global --add safe.directory '*'
- name: Download and unpack LLVM
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release download llvm-22.1.8 --pattern "llvm-linux-$(uname -m).zip"
unzip "llvm-linux-$(uname -m).zip"
rm "llvm-linux-$(uname -m).zip"
- name: Build
run: |
source /opt/rh/gcc-toolset-14/enable
cmake -B build -G Ninja \
-D Clang_DIR=llvm/lib/cmake/clang \
-D CMAKE_BUILD_TYPE=Release \
-D MRBIND_STATIC_BUILD=ON \
-D CMAKE_CXX_FLAGS="-ffunction-sections -fdata-sections" \
-D CMAKE_EXE_LINKER_FLAGS="-Wl,--gc-sections -Wl,-s"
cmake --build build --parallel $(nproc)
- name: Verify binaries
run: |
ls -l build/mrbind*
ldd build/mrbind*
- name: Test
run: |
export CLANG_RESOURCE_DIR="$(pwd)/llvm/lib/clang/22"
source /opt/rh/gcc-toolset-14/enable
echo g++ > examples/cxx.txt
examples/c/run.sh
PYTHON=python3.8 examples/python/run.sh
- name: Create package
run: |
mkdir mrbind
mv build/mrbind{,_gen_c,_gen_csharp} mrbind/
mv llvm/lib/clang/22 mrbind/resource-dir
zip -r mrbind-linux-$(uname -m).zip mrbind/
- name: Upload package
env:
GH_TOKEN: ${{ github.token }}
VERSION: ${{ needs.create-release.outputs.version }}
run: |
gh release upload ${VERSION} mrbind-linux-$(uname -m).zip --clobber
build-macos:
needs:
- create-release
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix: [arm64, x64]
include:
- arch: arm64
runner: macos-15
- arch: x64
runner: macos-15-intel
steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: true
- name: Build
run: |
export PATH="$(brew --prefix llvm@18)/bin:$PATH"
cmake -B build -G Ninja \
-D Clang_DIR=$(brew --prefix llvm@18)/lib/cmake/clang \
-D CMAKE_BUILD_TYPE=Release \
-D MRBIND_STATIC_BUILD=ON \
-D MRBIND_FORCE_LLVM_STATIC=ON \
-D CMAKE_PREFIX_PATH=$(brew --prefix zstd) \
-D CMAKE_OSX_DEPLOYMENT_TARGET=12.0
cmake --build build --parallel $(sysctl -n hw.logicalcpu)
- name: Verify build
run: |
ls -l build/mrbind*
otool -L build/mrbind*
vtool -show-build build/mrbind*
- name: Test
run: |
export CLANG_RESOURCE_DIR=$(brew --prefix llvm@18)/lib/clang/18
echo clang++ > examples/cxx.txt
examples/c/run.sh
PYTHON=python3.10 examples/python/run.sh
- name: Create package
run: |
mkdir mrbind
mv build/mrbind{,_gen_c,_gen_csharp} mrbind/
cp -R $(brew --prefix llvm@18)/lib/clang/18 mrbind/resource-dir
zip -r mrbind-macos-$(uname -m).zip mrbind/
- name: Upload package
env:
GH_TOKEN: ${{ github.token }}
VERSION: ${{ needs.create-release.outputs.version }}
run: |
gh release upload ${VERSION} mrbind-macos-$(uname -m).zip --clobber