Skip to content

Commit

Permalink
Establish an automatic weekly release
Browse files Browse the repository at this point in the history
We'll schedule weekly builds and releases to start every
Monday morning. During this process, we'll compile the
cbdb RPM package from its source and tag the latest commit
to generate a release note automatically.
  • Loading branch information
Baowen648 committed Jun 20, 2024
1 parent e1d276f commit cea287a
Showing 1 changed file with 102 additions and 0 deletions.
102 changes: 102 additions & 0 deletions .github/workflows/cbdb_release_weekly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
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'
cp cloudberrydb-${{ steps.set_value.outputs.MAIN_VERSION }}-1.el7.x86_64.rpm \
/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 }}

0 comments on commit cea287a

Please sign in to comment.