diff --git a/.github/workflows/cbdb_release_weekly.yml b/.github/workflows/cbdb_release_weekly.yml new file mode 100644 index 00000000000..445624ead5b --- /dev/null +++ b/.github/workflows/cbdb_release_weekly.yml @@ -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 }}