Skip to content

Commit 1b8cecc

Browse files
committed
centralize variables
1 parent e4b536b commit 1b8cecc

File tree

4 files changed

+18
-7
lines changed

4 files changed

+18
-7
lines changed

.github/workflows/build-and-release.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
- release
1111
workflow_dispatch:
1212

13+
env:
14+
POSTGIS_VERSION: 3.4.4
15+
PGROUTING_VERSION: 3.6.2
16+
1317
jobs:
1418
build-and-release-macos:
1519
strategy:
@@ -51,7 +55,7 @@ jobs:
5155
- name: Build PostgreSQL, PostGIS, and Dependencies
5256
id: build_postgres
5357
run: |
54-
./build-postgres-darwin.sh -v ${{ matrix.pg_version }} -g 3.4.4 -r 3.6.2
58+
./build-postgres-darwin.sh -v ${{ matrix.pg_version }} -g $POSTGIS_VERSION -r $PGROUTING_VERSION
5559
if [ "${{ matrix.os }}" == "macos-15-xlarge" ]; then
5660
echo "ARCH=arm64" >> $GITHUB_OUTPUT
5761
echo "FILENAME=postgresql-${{ matrix.pg_version }}-darwin-arm64.zip" >> $GITHUB_OUTPUT

build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,12 +314,13 @@ project(':custom-debian-platform') {
314314
inputs.property('archName', archName)
315315
inputs.property('dockerImage', dockerImage)
316316
inputs.property('postgisVersion', postgisVersionParam)
317+
inputs.property('pgroutingVersion', pgroutingVersionParam)
317318

318319
inputs.file("$rootDir/scripts/build-postgres-debian.sh")
319320
outputs.dir("$temporaryDir/bundle")
320321

321322
workingDir temporaryDir
322-
commandLine 'sh', "$rootDir/scripts/build-postgres-debian.sh", '-v', "$pgVersionParam", '-i', dockerImage, '-g', postgisVersionParam, '-o', qemuBindings
323+
commandLine 'sh', "$rootDir/scripts/build-postgres-debian.sh", '-v', "$pgVersionParam", '-i', dockerImage, '-g', postgisVersionParam, '-r', pgroutingVersionParam, '-o', qemuBindings
323324
}
324325

325326
task customDebianJar(group: 'build (custom)', type: Jar) {

build_and_release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function do_build {
1010
echo "=== Building ${version} ==="
1111
echo
1212

13-
./gradlew clean install -Pversion="${version}.0" -PpgVersion="${version}" -ParchName=amd64 -PpostgisVersion=3.4.4
13+
./gradlew clean install -Pversion="${version}.0" -PpgVersion="${version}" -ParchName=amd64 -PpostgisVersion=$POSTGIS_VERSION -PpgroutingVersion=$PGROUTING_VERSION
1414
cp custom-debian-platform/build/tmp/buildCustomDebianBundle/bundle/postgres-linux-debian.txz "release/postgresql-${version}-linux-amd64.txz"
1515
}
1616

scripts/build-postgres-debian.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,19 @@
22
set -ex
33

44
DOCKER_OPTS=
5+
PROJ_VERSION=8.2.1
6+
GEOS_VERSION=3.8.3
7+
GDAL_VERSION=3.4.3
58
POSTGIS_VERSION=
9+
PGROUTING_VERSION=
610
LITE_OPT=false
711

812
while getopts "v:i:g:o:l" opt; do
913
case $opt in
1014
v) PG_VERSION=$OPTARG ;;
1115
i) IMG_NAME=$OPTARG ;;
1216
g) POSTGIS_VERSION=$OPTARG ;;
17+
r) PGROUTING_VERSION=$OPTARG ;;
1318
o) DOCKER_OPTS=$OPTARG ;;
1419
l) LITE_OPT=true ;;
1520
\?) exit 1 ;;
@@ -36,10 +41,11 @@ docker run -i --rm -v ${TRG_DIR}:/usr/local/pg-dist \
3641
-e PG_VERSION=$PG_VERSION \
3742
-e POSTGIS_VERSION=$POSTGIS_VERSION \
3843
-e ICU_ENABLED=$ICU_ENABLED \
39-
-e PROJ_VERSION=8.2.1 \
44+
-e PROJ_VERSION=$PROJ_VERSION \
4045
-e PROJ_DATUMGRID_VERSION=1.8 \
41-
-e GEOS_VERSION=3.8.3 \
42-
-e GDAL_VERSION=3.4.3 \
46+
-e GEOS_VERSION=$GEOS_VERSION \
47+
-e GDAL_VERSION=$GDAL_VERSION \
48+
-e PGROUTING_VERSION=$PGROUTING_VERSION \
4349
$DOCKER_OPTS $IMG_NAME /bin/bash -ex -c 'echo "Starting building postgres binaries" \
4450
&& sed "[email protected]@us.archive.ubuntu.com@" -i /etc/apt/sources.list \
4551
&& ln -snf /usr/share/zoneinfo/Etc/UTC /etc/localtime && echo "Etc/UTC" > /etc/timezone \
@@ -143,7 +149,7 @@ $DOCKER_OPTS $IMG_NAME /bin/bash -ex -c 'echo "Starting building postgres binari
143149
&& make install \
144150
&& apt-get install -y --no-install-recommends cmake libboost-graph-dev \
145151
&& mkdir -p /usr/src/pgrouting \
146-
&& curl -sL "https://github.com/pgRouting/pgrouting/archive/v3.4.1.tar.gz" | tar -xzf - -C /usr/src/pgrouting --strip-components 1 \
152+
&& curl -sL "https://github.com/pgRouting/pgrouting/archive/v$PGROUTING_VERSION.tar.gz" | tar -xzf - -C /usr/src/pgrouting --strip-components 1 \
147153
&& cd /usr/src/pgrouting && mkdir build && cd build \
148154
&& cmake -DWITH_DOC=OFF -DCMAKE_INSTALL_PREFIX=/usr/local/pg-build .. \
149155
&& make \

0 commit comments

Comments
 (0)