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 5, 2024
1 parent d73da65 commit 4463520
Showing 1 changed file with 80 additions and 0 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/cbdb_release_weekly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
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 bash bison-devel bzip2 curl flex-devel less \
libevent openssh-clients perl rsync scl-utils sed tar \
unzip which
sudo yum -y install epel-release centos-release-scl \
devtoolset-10-gcc devtoolset-10-gcc-c++ devtoolset-10 \
devtoolset-10-binutils
echo -e "/usr/local/lib \n/usr/local/lib64" >> /etc/ld.so.conf
echo -e "/usr/lib \n/usr/lib64" >> /etc/ld.so.conf
sudo ldconfig
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
cp cloudberrydb-${{ steps.set_value.outputs.MAIN_VERSION }}-1.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 4463520

Please sign in to comment.