Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add weekly build and release process #459

Merged
merged 1 commit into from
Jun 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions .github/workflows/cbdb_release_weekly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Build and Release RPM Weekly
on:
schedule:
- cron: '0 16 * * 1'
jobs:
Build-rpm:
runs-on: cbdb-weekly
steps:
- uses: actions/checkout@v3
with:
ref: cbdb-release-weekly
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.RELEASE_NIGHTLY }}
Loading