Skip to content

Merge branch 'POLARDB_11_DEV' into POLARDB_11_STABLE #4

Merge branch 'POLARDB_11_DEV' into POLARDB_11_STABLE

Merge branch 'POLARDB_11_DEV' into POLARDB_11_STABLE #4

Workflow file for this run

name: build packages
on:
push:
tags:
- "v*"
branches: [ POLARDB_11_DEV, POLARDB_11_STABLE ]
pull_request:
branches: [ POLARDB_11_DEV, POLARDB_11_STABLE ]
paths:
- '.github/workflows/regression-test.yml'
- 'config/**'
- 'contrib/**'
- 'external/**'
- 'src/**'
- 'configure*'
- 'polardb_build.sh'
# trigger testing manually
workflow_dispatch:
jobs:
build-and-publish-rpm:
runs-on: ubuntu-latest
strategy:
matrix:
base_image: [ centos7, anolis8, rocky8 ]
steps:
- name: Fetch source code
uses: actions/checkout@v4
- name: Create and start the container
run: |
docker create \
-t \
--name polardb_${{ matrix.base_image }} \
-v `pwd`:/home/postgres/PolarDB-for-PostgreSQL \
polardb/polardb_pg_devel:${{ matrix.base_image }} \
bash && \
docker start polardb_${{ matrix.base_image }}
- name: Build RPM package
run: |
docker exec \
polardb_${{ matrix.base_image }} \
bash -c "cd /home/postgres/PolarDB-for-PostgreSQL && \
sudo chown -R postgres:postgres ./ && \
cd ./package/rpm && \
if [ -f /etc/bashrc ]; then source /etc/bashrc; fi && \
./build-rpm.sh"
- name: Get package name
run: |
cd ./package/rpm/x86_64 && RPMNAME=`ls` && echo "rpmname=$RPMNAME" >> $GITHUB_ENV
- name: Upload artifact
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v4
with:
name: ${{ env.rpmname }}
path: ./package/rpm/x86_64/${{ env.rpmname }}
compression-level: 0
- name: Change ownership of the source code
run: |
sudo chown -R runner:runner `pwd`
release-rpm:
if: startsWith(github.ref, 'refs/tags/')
needs: build-and-publish-rpm
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
pattern: |
*.rpm
merge-multiple: true
- name: Upload artifacts to release
uses: softprops/action-gh-release@v2
with:
files: |
*.rpm