Skip to content

Build and Release RPM Weekly #4

Build and Release RPM Weekly

Build and Release RPM Weekly #4

name: Build and Release RPM Weekly
on:
schedule:
- cron: '0 16 * * 1'
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: "true"
ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: "node16"
jobs:
Build-rpm:
runs-on: cbdb-weekly
steps:
- uses: actions/checkout@v3
with:
ref: main
fetch-depth: 0
- name: Environment Setup
run: |
pushd $GITHUB_WORKSPACE
pushd deploy/build
sudo bash README.CentOS.bash
popd
sudo yum -y install scl-utils centos-release-scl devtoolset-10
echo "Environment setup completed !!!" && gcc -v
- name: Get LATEST Tag
id: set_value
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git tag -d $(git tag)
git fetch --tags
timestamp=$(date +"%Y%m%d")
rm -rf /tmp/release && mkdir /tmp/release
current_tag=$(git tag | sort -V -r | head -n 1)
main_version=$(echo $current_tag | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+')
latest_tag="$main_version-$timestamp-weekly"
echo "The current tag that already exists is $current_tag"
echo "The main version is $main_version"
echo "The latest tag is $latest_tag"
echo "::set-output name=LATEST_TAG::${latest_tag}"
echo "::set-output name=MAIN_VERSION::${main_version}"
sudo git tag $latest_tag && git tag
- name: Build RPM Package
run: |
./configure --with-perl --with-python --with-libxml --with-gssapi \
--prefix=/home/gpadmin/cbdb-install
make -j16 && make install
echo "Build RPM Package"
source ~/.bashrc
mkdir -p tmp/usr/local/cloudberrydb
cp -a /home/gpadmin/cbdb-install/* tmp/usr/local/cloudberrydb
fpm -s dir -t rpm -n cloudberrydb \
-v ${{ steps.set_value.outputs.MAIN_VERSION }} -p ./ -C tmp \
--name 'cloudberrydb' \
--license 'Apache License Version 2.0' \
--iteration "1.el7" \
--vendor 'https://github.com/cloudberrydb/cloudberrydb' \
--url 'http://www.cloudberrydb.org' \
--maintainer 'https://github.com/cloudberrydb/cloudberrydb' \
--description 'A High Performance Massively Parallel Data Warehouse' \
-d 'apr-devel' \
-d 'bison' \
-d 'bzip2-devel' \
-d 'flex' \
-d 'gcc' \
-d 'gcc-c++' \
-d 'krb5-devel' \
-d 'libcurl-devel' \
-d 'libevent-devel' \
-d 'libkadm5' \
-d 'libyaml-devel' \
-d 'libxml2-devel' \
-d 'libzstd-devel' \
-d 'openssl-devel' \
-d 'perl-ExtUtils-Embed' \
-d 'python3-devel' \
-d 'python3-pip' \
-d 'readline-devel' \
-d 'xerces-c-devel' \
-d 'zlib-devel' \
-d 'scl-utils' \
-d 'centos-release-scl' \
-d 'postgresql' \
-d 'postgresql-devel'
rpm_files=cloudberrydb-${{ steps.set_value.outputs.MAIN_VERSION }}-1.el7.x86_64.rpm
timestamp=$(date +"%Y%m%d%H%M%S")
new_filename="${rpm_files%.*}-$timestamp.rpm"
mv "$rpm_files" "$new_filename"
cp $new_filename /tmp/release
- name: Release
uses: softprops/action-gh-release@v1
with:
files: "/tmp/release/*.rpm"
name: v${{ steps.set_value.outputs.LATEST_TAG }}
tag_name: "${{ steps.set_value.outputs.LATEST_TAG }}"
prerelease: true
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}