-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: pgcat package (deb) | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
packageVersion: | ||
default: "1.1.1" | ||
jobs: | ||
build: | ||
strategy: | ||
max-parallel: 1 | ||
fail-fast: false # Let the other job finish, or they can lock each other out | ||
matrix: | ||
os: ["buildjet-4vcpu-ubuntu-2204", "buildjet-4vcpu-ubuntu-2204-arm"] | ||
|
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
- name: Install dependencies | ||
env: | ||
DEBIAN_FRONTEND: noninteractive | ||
TZ: Etc/UTC | ||
run: | | ||
curl -sLO https://github.com/deb-s3/deb-s3/releases/download/0.11.4/deb-s3-0.11.4.gem | ||
sudo gem install deb-s3-0.11.4.gem | ||
dpkg-deb --version | ||
- name: Build and release package | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ vars.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
AWS_DEFAULT_REGION: ${{ vars.AWS_DEFAULT_REGION }} | ||
run: | | ||
if [[ $(arch) == "x86_64" ]]; then | ||
export ARCH=amd64 | ||
else | ||
export ARCH=arm64 | ||
fi | ||
bash utilities/deb.sh ${{ inputs.packageVersion }} | ||
deb-s3 upload \ | ||
--lock \ | ||
--bucket apt.postgresml.org \ | ||
pgcat-${{ inputs.packageVersion }}-ubuntu22.04-${ARCH}.deb \ | ||
--codename $(lsb_release -cs) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Package: pgcat | ||
Version: ${PACKAGE_VERSION} | ||
Section: database | ||
Priority: optional | ||
Architecture: ${ARCH} | ||
Maintainer: PostgresML <[email protected]> | ||
Homepage: https://postgresml.org | ||
Description: PgCat - NextGen PostgreSQL Pooler | ||
PostgreSQL pooler and proxy (like PgBouncer) with support for sharding, load balancing, failover and mirroring. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
# | ||
# Build an Ubuntu deb. | ||
# | ||
script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
deb_dir="/tmp/pgcat-build" | ||
export PACKAGE_VERSION=${1:-"1.1.1"} | ||
if [[ $(arch) == "x86_64" ]]; then | ||
export ARCH=amd64 | ||
else | ||
export ARCH=arm64 | ||
fi | ||
|
||
cd "$script_dir/.." | ||
cargo build --release | ||
|
||
rm -rf "$deb_dir" | ||
mkdir -p "$deb_dir/DEBIAN" | ||
mkdir -p "$deb_dir/usr/bin" | ||
mkdir -p "$deb_dir/etc" | ||
|
||
cp target/release/pgcat "$deb_dir/usr/bin/pgcat" | ||
chmod +x "$deb_dir/usr/bin/pgcat" | ||
|
||
cp pgcat.toml "$deb_dir/etc/pgcat.toml" | ||
|
||
(cat control | envsubst) > "$deb_dir/DEBIAN/control" | ||
|
||
dpkg-deb \ | ||
--root-owner-group \ | ||
-z1 \ | ||
--build "$deb_dir" \ | ||
pgcat-${PACKAGE_VERSION}-ubuntu22.04-${ARCH}.deb |