docs: update README.md #55
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build packages | |
on: | |
push: | |
tags: | |
- "v*" | |
branches: [ POLARDB_15_STABLE ] | |
pull_request: | |
branches: [ POLARDB_15_STABLE ] | |
paths: | |
- '.github/workflows/package.yml' | |
- 'config/**' | |
- 'contrib/**' | |
- 'external/**' | |
- 'package/**' | |
- 'src/**' | |
- 'configure*' | |
- 'build.sh' | |
# trigger testing manually | |
workflow_dispatch: | |
jobs: | |
build-and-publish-rpm: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
base_image: [ 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 |