Skip to content

Restore the portal-level snapshot after procedure COMMIT/ROLLBACK. #11

Restore the portal-level snapshot after procedure COMMIT/ROLLBACK.

Restore the portal-level snapshot after procedure COMMIT/ROLLBACK. #11

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, rocky9 ]
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`
build-and-publish-deb:
runs-on: ubuntu-latest
strategy:
matrix:
base_image: [ ubuntu20.04, ubuntu22.04, ubuntu24.04 ]
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 deb package
run: |
docker exec \
polardb_${{ matrix.base_image }} \
bash -c "cd /home/postgres/PolarDB-for-PostgreSQL && \
sudo chown -R postgres:postgres ./ && \
cd ./package/debian && \
if [ -f /etc/bashrc ]; then source /etc/bashrc; fi && \
./build-deb.sh"
- name: Get package name
run: |
cd ./package/debian && DEBNAME=`ls *.deb` && echo "debname=$DEBNAME" >> $GITHUB_ENV
- name: Upload artifact
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v4
with:
name: ${{ env.debname }}
path: ./package/debian/${{ env.debname }}
compression-level: 0
- name: Change ownership of the source code
run: |
sudo chown -R runner:runner `pwd`
release-packages:
if: startsWith(github.ref, 'refs/tags/')
needs: [ build-and-publish-rpm, build-and-publish-deb ]
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
pattern: |
*.{rpm,deb}
merge-multiple: true
- name: Upload artifacts to release
uses: softprops/action-gh-release@v2
with:
files: |
*.rpm
*.deb