@@ -217,10 +217,21 @@ jobs:
217217 rm -f public.asc; rm -f private.asc
218218 mkdir -p "${REPOSITORY}"/scripts/pg-deeplake/ &&
219219 cp -f postgres/scripts/install.sh "${REPOSITORY}"/scripts/pg-deeplake/
220+
221+ # Extract version using pkg-config if VERSION is not set
222+ if [ -z "${VERSION}" ]; then
223+ echo -e "${YELLOW}VERSION not set, extracting from pkg-config...${DEFAULT}"
224+ PKG_VERSION=$(PKG_CONFIG_PATH="cpp/.ext/deeplake_api/lib/pkgconfig" pkg-config --modversion deeplake_api)
225+ VERSION="${PKG_VERSION}-1"
226+ echo -e "${GREEN}Detected version: ${VERSION}${DEFAULT}"
227+ else
228+ VERSION="${VERSION}-1"
229+ fi
230+
220231 for type in deb rpm; do
221232 for arch in amd64 arm64; do
222233 echo -e "${YELLOW}Building the ${type} repository...${DEFAULT}"
223- bash postgres/scripts/build_${type}.sh "${VERSION}"-1 "${REPOSITORY}" "${arch}" "${KEY_ID}" "${SUPPORTED_VERSIONS}"
234+ bash postgres/scripts/build_${type}.sh "${VERSION}" "${REPOSITORY}" "${arch}" "${KEY_ID}" "${SUPPORTED_VERSIONS}"
224235 done
225236 done
226237
@@ -275,7 +286,18 @@ jobs:
275286 PG_VERSION : ${{ matrix.version }}
276287 run : |-
277288 mkdir -p ./debs
278- VERSION="${{ inputs.version }}"
289+
290+ # Extract version from tag or use default
291+ if [ -n "${{ inputs.version }}" ]; then
292+ VERSION="${{ inputs.version }}"
293+ elif [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
294+ # Extract version from tag (e.g., v4.4.4 -> 4.4.4)
295+ VERSION="${GITHUB_REF#refs/tags/v}"
296+ else
297+ # Default version if neither input nor tag is available
298+ VERSION="latest"
299+ fi
300+
279301 wget https://packages.activeloop.io/deb/pg-deeplake/pool/main/pg-deeplake-${PG_VERSION}_${VERSION}-1_amd64.deb -O ./debs/pg-deeplake-${PG_VERSION}_${VERSION}-1_amd64.deb
280302 wget https://packages.activeloop.io/deb/pg-deeplake/pool/main/pg-deeplake-${PG_VERSION}_${VERSION}-1_arm64.deb -O ./debs/pg-deeplake-${PG_VERSION}_${VERSION}-1_arm64.deb
281303 sed s/BASE_IMAGE/postgres:${PG_VERSION}-bookworm/g postgres/Dockerfile > Dockerfile.build
0 commit comments