@@ -5,34 +5,52 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
55package_version=" $1 "
66
77if [[-z " $package_version " ]]; then
8- echo " postgresml package build and release script"
9- echo " usage:$0 <package version, e.g. 2.7.12 >"
10- exit 1
8+ echo " postgresml package build and release script"
9+ echo " usage:$0 <package version, e.g. 2.10.0 >"
10+ exit 1
1111fi
1212
1313if ! which deb-s3; then
14- curl -sLO https://github.com/deb-s3/deb-s3/releases/download/0.11.4/deb-s3-0.11.4.gem
15- sudo gem install deb-s3-0.11.4.gem
16- deb-s3
14+ curl -sLO https://github.com/deb-s3/deb-s3/releases/download/0.11.4/deb-s3-0.11.4.gem
15+ sudo gem install deb-s3-0.11.4.gem
16+ deb-s3
1717fi
1818
1919function package_name() {
20- echo " postgresml-$1 -$package_version -ubuntu22.04-all.deb"
20+ local pg_version=$1
21+ local ubuntu_version=$2
22+ echo " postgresml-${pg_version} -${package_version} -ubuntu${ubuntu_version} -all.deb"
2123}
2224
23- for pg in {12..16}; do
24- bash${SCRIPT_DIR} /build.sh${package_version} ${pg}
25-
26- if [[! -f $( package_name${pg} ) ]]; then
27- echo " File$( package_name${pg} ) doesn't exist"
28- exit 1
29- fi
30-
31- deb-s3 upload \
32- --lock \
33- --bucket apt.postgresml.org \
34- $( package_name${pg} ) \
35- --codename$( lsb_release -cs)
36-
37- rm$( package_name${pg} )
25+ # Active LTS Ubuntu versions
26+ ubuntu_versions=(" 20.04" " 22.04" " 24.04" )
27+
28+ # Map Ubuntu versions to codenames
29+ declare -A ubuntu_codenames=(
30+ [" 20.04" ]=" focal"
31+ [" 22.04" ]=" jammy"
32+ [" 24.04" ]=" noble"
33+ )
34+
35+ for ubuntu_version in " ${ubuntu_versions[@]} " ; do
36+ codename=${ubuntu_codenames[$ubuntu_version]}
37+ echo " Building packages for Ubuntu${ubuntu_version} (${codename} )"
38+
39+ for pg in {11..17}; do
40+ echo " Building PostgreSQL${pg} package..."
41+ bash${SCRIPT_DIR} /build.sh${package_version} ${pg} ${ubuntu_version}
42+
43+ if [[! -f $( package_name${pg} ${ubuntu_version} ) ]]; then
44+ echo " File$( package_name${pg} ${ubuntu_version} ) doesn't exist"
45+ exit 1
46+ fi
47+
48+ deb-s3 upload \
49+ --lock \
50+ --bucket apt.postgresml.org \
51+ $( package_name${pg} ${ubuntu_version} ) \
52+ --codename${codename}
53+
54+ rm$( package_name${pg} ${ubuntu_version} )
55+ done
3856done