Debian packaging & apt repo
build-deb.sh <pg-major>— runscargo pgrx packageagainst the systempostgresql-server-dev-<major>, then wraps the staged tree intopostgresql-<major>-pg-replica_<version>_<arch>.debwithdpkg-deb.build-apt-repo.sh [deb-dir]— lays outpool/+dists/stable/main/binary-<arch>/, generatesPackages(.gz)(dpkg-scanpackages) and aRelease(apt-ftparchive), then GPG-signs it (Release.gpg+InRelease) and drops the public key (pg_replica.gpg) andinstall.shat the repo root.install.sh— installs the public key to/usr/share/keyrings/pg_replica.gpgand adds asigned-byapt source pointing at the Pages URL..github/workflows/packages.yml— on a[cd]commit tomain(or manual dispatch), builds the matrix (PG 18 amd64/arm64), assembles + signs the repo, and deploys it to GitHub Pages.
One-time repo setup
- Signing key. Generate a passphrase-less signing key (CI can’t type a passphrase):
gpg --batch --quick-generate-key "pg_replica apt <info@nordlet.com>" rsa4096 sign never
gpg --armor --export-secret-keys "pg_replica apt" > private.asc
Add the contents of private.asc as the repo secret GPG_PRIVATE_KEY
(gh secret set GPG_PRIVATE_KEY < private.asc), then delete private.asc.
Pages. Repo → Settings → Pages → Source = GitHub Actions.
Permissions. The workflow already requests
pages: write+id-token: write.
After that, push a commit containing [cd] (or run the workflow manually) to publish.
Local test (Debian/Ubuntu or WSL)
sudo apt-get install -y postgresql-server-dev-18 build-essential clang libclang-dev
cargo install cargo-pgrx --version 0.18.1 --locked
bash packaging/build-deb.sh 18
sudo apt-get install -y ./dist/postgresql-18-pg-replica_*.deb
build-apt-repo.sh additionally needs dpkg-dev apt-utils gnupg and a GPG_KEY_ID env var.