Skip to content

Commit 6deb3e6

Browse files
OffgridwithJDclaude
andcommitted
ci: script to build per-version source tarballs
Add ci_scripts/build-source-tarballs.sh, which produces one source tarball per supported PostgreSQL major (16, 17, 18). Each tarball is a complete open_pg_tde source tree including the libkmip submodule (which git archive omits on its own), with patches/postgresql pruned to only the target major so it carries exactly the core patch it needs. Output: open_pg_tde-<version>-pg<major>.tar.gz. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 1f9d44a commit 6deb3e6

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/bash
2+
#
3+
# Build one source tarball per supported PostgreSQL major version. Each tarball
4+
# is a complete open_pg_tde source tree (including the libkmip submodule, which
5+
# git archive does not include on its own) with patches/postgresql pruned to
6+
# only the target major, so it carries exactly the core patch it needs.
7+
#
8+
# Usage: ci_scripts/build-source-tarballs.sh [output-dir]
9+
# Output: <output-dir>/open_pg_tde-<version>-pg<major>.tar.gz (default dist/)
10+
set -euo pipefail
11+
12+
repo="$(cd -- "$(dirname "$0")" >/dev/null 2>&1; pwd -P)/.."
13+
cd "$repo"
14+
15+
majors="16 17 18"
16+
version=$(grep -oE "version: '[0-9]+\.[0-9]+\.[0-9]+'" meson.build | head -1 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
17+
[ -n "$version" ] || { echo "could not determine version from meson.build" >&2; exit 1; }
18+
19+
outdir="${1:-dist}"
20+
mkdir -p "$outdir"
21+
outdir="$(cd "$outdir" && pwd)"
22+
23+
for major in $majors; do
24+
name="open_pg_tde-${version}-pg${major}"
25+
stage="$outdir/$name"
26+
rm -rf "$stage"
27+
mkdir -p "$stage"
28+
29+
# Main repository source at HEAD.
30+
git archive --format=tar HEAD | tar -x -C "$stage"
31+
32+
# The libkmip submodule (git archive omits submodule contents).
33+
if [ -e src/libkmip/.git ]; then
34+
git -C src/libkmip archive --format=tar HEAD | tar -x -C "$stage/src/libkmip"
35+
else
36+
echo "warning: src/libkmip submodule is not checked out; tarball will be incomplete" >&2
37+
fi
38+
39+
# Keep only the target major's core patch series.
40+
for other in $majors; do
41+
[ "$other" = "$major" ] || rm -rf "$stage/patches/postgresql/$other"
42+
done
43+
44+
tar --owner=0 --group=0 --sort=name -czf "$outdir/$name.tar.gz" -C "$outdir" "$name"
45+
rm -rf "$stage"
46+
echo "built $outdir/$name.tar.gz"
47+
done

0 commit comments

Comments
 (0)