Build gRPC+Boost .deb and .rpms #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build gRPC+Boost .deb and .rpms | |
on: | |
workflow_dispatch: | |
env: | |
E2SAR_VER: 0.1.3 | |
DEPS_VER: 1.85.0-boost-1.54.1-grpc | |
FINAL_INSTALL: /usr/local | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04] | |
steps: | |
- name: Set up environment | |
run: | | |
if [[ ${{ matrix.os }} == *"ubuntu"* ]]; then | |
sudo apt-get -yq update | |
sudo apt-get -yq install python3-pip build-essential autoconf cmake libtool pkg-config libglib2.0-dev ninja-build openssl libssl-dev libsystemd-dev protobuf-compiler libre2-dev rubygems build-essential squashfs-tools sed | |
sudo gem install fpm | |
elif [[ ${{ matrix.os }} == *"rocky"* ]]; then | |
sudo dnf -yq install epel-release | |
sudo dnf -yq --enablerepo=devel update | |
sudo dnf -yq --enablerepo=devel install gcc gcc-c++ kernel-devel make | |
sudo dnf -yq --enablerepo=devel install python3-pip autoconf cmake libtool pkg-config ninja-build openssl protobuf-compiler glib2-devel re2-devel libquadmath-devel python39-devel python39 rpm-build squashfs-tools ruby | |
sudo gem install fpm | |
fi | |
- name: Set up authentication for HTTPS | |
run: | | |
git config --global url."https://github.com/".insteadOf "[email protected]:" # Force HTTPS to use PAT | |
- name: Create install directories | |
run: | | |
mkdir -p package/usr/local/include/ | |
mkdir -p package/usr/local/lib | |
mkdir -p package/usr/local/lib64 | |
- name: Download built boost and grpc artifact | |
if: steps.cache.outputs.cache-hit != 'true' # Only run if cache wasn't hit | |
id: download-artifact | |
uses: dawidd6/action-download-artifact@v6 | |
with: | |
workflow: builddeps.yml | |
name: ${{ matrix.os }}-package-e2sar-deps-${{ env.E2SAR_VER }} | |
path: ./ | |
- name: Untar the grpc and boost install tree | |
run: | | |
tar -zxf package-e2sar-deps-${{ env.E2SAR_VER }}.tar.gz | |
ls -l package/usr/local/bin | |
- name: Update pkgconfig prefix files for final installation | |
run: | | |
# update pkgconfig files for the install location. DESTDIR didn't work | |
export IDIR=`pwd`/package/usr/local | |
echo Updating pkgconfig files prefix from ${IDIR} to ${{ env.FINAL_INSTALL }} | |
for file in `ls -1 ${IDIR}/lib/pkgconfig`; do sed -i "s|${IDIR}|${{ env.FINAL_INSTALL }}|g" ${IDIR}/lib/pkgconfig/${file}; done | |
- name: Package into .deb or .rpm | |
run: | | |
pushd package/ && tar -zcf ../e2sar-deps.tar.gz usr/ && popd | |
if [[ ${{ matrix.os }} == *"ubuntu"* ]]; then | |
fpm -s tar -t deb -n e2sar-deps -v ${{ env.E2SAR_VER }} --prefix=/ e2sar-deps.tar.gz | |
elif [[ ${{ matrix.os }} == *"rocky"* ]]; then | |
fpm -s tar -t rpm -n e2sar-deps -v ${{ env.E2SAR_VER }} --prefix=/ e2sar-deps.tar.gz | |
fi | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.os }}-e2sar-deps-${{ env.E2SAR_VER }}-package | |
path: | | |
*.deb | |
*.rpm |