Skip to content

Commit

Permalink
Merge pull request containerd#193 from liulanzheng/main
Browse files Browse the repository at this point in the history
update dev-release for el7 and el8
  • Loading branch information
BigVan authored Apr 6, 2023
2 parents 3249fb0 + 183247d commit 903c942
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 23 deletions.
77 changes: 55 additions & 22 deletions .github/workflows/dev-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ env:
BUILD_TYPE: Release

jobs:
dev-build-rpm:
name: "Development Release Rpm"
dev-build-rpm-el7:
name: "Development Release Rpm for el7"
runs-on: ubuntu-22.04
container: centos:7

Expand All @@ -19,70 +19,102 @@ jobs:
shell: bash
run: |
yum install -y epel-release libaio-devel libcurl-devel openssl-devel libnl3-devel e2fsprogs-devel centos-release-scl
yum install -y cmake3 git rpm-build devtoolset-7-gcc-c++ make libzstd-static
yum install -y cmake3 rpm-build devtoolset-7-gcc-c++ make libzstd-static
yum install -y yum install https://repo.ius.io/ius-release-el7.rpm
yum remove -y git
yum install -y git236
- uses: actions/checkout@v3

- name: Build
shell: bash
run: |
git config --global --add safe.directory '*'
git submodule update --init
mkdir build
cd build
cmake3 .. -DPACKAGE_RELEASE=1.el7 -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_TESTING=0 -DENABLE_DSA=0 -DENABLE_ISAL=0 -DCMAKE_C_COMPILER=/opt/rh/devtoolset-7/root/usr/bin/gcc -DCMAKE_CXX_COMPILER=/opt/rh/devtoolset-7/root/usr/bin/g++
make -j64
cpack3
- name: Upload
uses: actions/upload-artifact@v3
with:
name: release-rpm-el7
path: build/overlaybd-*.rpm

dev-build-rpm-el8:
name: "Development Release Rpm for el8"
runs-on: ubuntu-22.04
container: centos:8

steps:
- name: Install Dependencies
shell: bash
run: |
rm -rf /etc/yum.repos.d/* && curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
yum install -y epel-release libaio-devel libcurl-devel openssl-devel libnl3-devel e2fsprogs-devel
yum install -y cmake3 git rpm-build gcc gcc-c++ make libzstd-devel
- uses: actions/checkout@v3

- name: Build
shell: bash
run: |
echo git fetching ${{ github.repository }}@${{ github.sha }}
git clone https://github.com/${{ github.repository }} overlaybd
cd overlaybd
git checkout ${{ github.sha }}
git submodule update --init
mkdir build
cd build
cmake3 .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_TESTING=0 -DENABLE_DSA=0 -DENABLE_ISAL=0 -DCMAKE_C_COMPILER=/opt/rh/devtoolset-7/root/usr/bin/gcc -DCMAKE_CXX_COMPILER=/opt/rh/devtoolset-7/root/usr/bin/g++
cmake3 .. -DPACKAGE_RELEASE=1.el8 -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_TESTING=0 -DENABLE_DSA=0 -DENABLE_ISAL=0
make -j64
cpack3
- name: Upload
uses: actions/upload-artifact@v3
with:
name: release-rpm
path: overlaybd/build/overlaybd-*.rpm
name: release-rpm-el8
path: build/overlaybd-*.rpm

dev-build-deb:
name: "Development Release Deb"
runs-on: ubuntu-22.04
container: ubuntu:18.04

steps:
- uses: actions/checkout@v3

- name: Install Dependencies
shell: bash
run: |
apt-get update -y
apt-get install -y libgflags-dev libcurl4-openssl-dev libssl-dev libaio-dev libnl-3-dev libnl-genl-3-dev rpm git wget make g++
apt-get install -y software-properties-common
add-apt-repository ppa:git-core/ppa
apt-get install -y libgflags-dev libcurl4-openssl-dev libssl-dev libaio-dev libnl-3-dev libnl-genl-3-dev rpm wget make g++ git
apt-get install -y uuid-dev libjson-c-dev libkmod-dev libsystemd-dev autoconf automake libtool libpci-dev nasm libzstd-dev libext2fs-dev zlib1g-dev
wget https://cmake.org/files/v3.15/cmake-3.15.0-Linux-x86_64.tar.gz
tar -zxvf cmake-3.15.0-Linux-x86_64.tar.gz
cp -r cmake-3.15.0-Linux-x86_64 /usr/local/
- uses: actions/checkout@v3

- name: Build
shell: bash
run: |
export PATH="/usr/local/cmake-3.15.0-Linux-x86_64/bin:$PATH"
echo git fetching ${{ github.repository }}@${{ github.sha }}
git clone https://github.com/${{ github.repository }} overlaybd
cd overlaybd
git checkout ${{ github.sha }}
git config --global --add safe.directory '*'
git submodule update --init
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_TESTING=0 -DENABLE_DSA=0 -DENABLE_ISAL=0 -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++
make -j64
cpack
- name: save deb
- name: Upload
uses: actions/upload-artifact@v3
with:
name: release-deb
path: overlaybd/build/overlaybd-*.deb
path: build/overlaybd-*.deb

dev-release:
runs-on: ubuntu-20.04
needs: [dev-build-rpm, dev-build-deb]
runs-on: ubuntu-22.04
needs: [dev-build-rpm-el7, dev-build-rpm-el8, dev-build-deb]
steps:
- name: Download builds and release notes
uses: actions/download-artifact@v3
Expand All @@ -96,5 +128,6 @@ jobs:
prerelease: false
title: "Development Build"
files: |
output/release-rpm/*.rpm
output/release-rpm-el7/*.rpm
output/release-rpm-el8/*.rpm
output/release-deb/*.deb
7 changes: 6 additions & 1 deletion CMake/pack.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
set(CPACK_GENERATOR "RPM;DEB")
set(CPACK_PACKAGE_NAME ${PROJECT_NAME})
set(CPACK_PACKAGE_RELEASE "1" CACHE STRING "")
if (PACKAGE_RELEASE)
set(CPACK_PACKAGE_RELEASE ${PACKAGE_RELEASE})
else()
set(CPACK_PACKAGE_RELEASE "1")
endif()

set(CPACK_PACKAGE_CONTACT "The overlaybd authors")
set(CPACK_PACKAGE_VENDOR "Overlaybd")
set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
Expand Down

0 comments on commit 903c942

Please sign in to comment.