📦 build: fix pgvectors and VectorChord install url

This commit is contained in:
2025-07-09 17:49:17 +07:00
parent 99ab8ff058
commit 927bd8745d
2 changed files with 14 additions and 4 deletions

View File

@@ -116,6 +116,7 @@ jobs:
build-args: |
CNPG_TAG=${{ matrix.cnpg }}
PGVECTORS_TAG=${{ matrix.pgvectors }}
VECTORCHORD_TAG=${{ matrix.vectorchord }}
results:
if: ${{ always() }}

View File

@@ -9,10 +9,19 @@ ARG TARGETARCH
# drop to root to install packages
USER root
ADD https://github.com/tensorchord/pgvecto.rs/releases/download/$PGVECTORS_TAG/vectors-pg${CNPG_TAG%.*}_${PGVECTORS_TAG#"v"}_$TARGETARCH.deb ./pgvectors.deb
RUN apt install ./pgvectors.deb
ADD https://github.com/tensorchord/VectorChord/releases/download/$VECTORCHORD_TAG/postgresql-${CNPG_TAG%.*}-vchord_${VECTORCHORD_TAG#"v"}-1_$TARGETARCH.deb ./vchord.deb
RUN apt-get install -y ./vchord.deb && rm -f ./vchord.deb
RUN apt update && apt install -y curl wget
# Extract PostgreSQL major version from CNPG_TAG (handles formats like "17.5-bookworm" -> "17")
RUN PG_MAJOR=$(echo $CNPG_TAG | cut -d'-' -f1 | cut -d'.' -f1) && \
curl -L -o ./pgvectors.deb "https://github.com/tensorchord/pgvecto.rs/releases/download/$PGVECTORS_TAG/vectors-pg${PG_MAJOR}_${PGVECTORS_TAG#"v"}_$TARGETARCH.deb" && \
apt install -y ./pgvectors.deb && \
rm -f ./pgvectors.deb
RUN PG_MAJOR=$(echo $CNPG_TAG | cut -d'-' -f1 | cut -d'.' -f1) && \
curl -L -o ./vchord.deb "https://github.com/tensorchord/VectorChord/releases/download/$VECTORCHORD_TAG/postgresql-${PG_MAJOR}-vchord_${VECTORCHORD_TAG}-1_$TARGETARCH.deb" && \
apt install -y ./vchord.deb && \
rm -f ./vchord.deb
# go back to postgres user
USER postgres