From cc98ca837c24117ac360dfc040ef5ca25ce947a7 Mon Sep 17 00:00:00 2001 From: Jimmy Huang Date: Mon, 30 Sep 2024 09:04:30 -0700 Subject: [PATCH] add github ci workflow for postgres 17 --- .github/workflows/postgress12_16.yml | 28 ++++++++++++++++++++++++++++ .gitignore | 1 + Dockerfile_alpine | 10 +++++----- pg_cjk_parser.c | 2 +- 4 files changed, 35 insertions(+), 6 deletions(-) diff --git a/.github/workflows/postgress12_16.yml b/.github/workflows/postgress12_16.yml index d08d2d7..2d71e30 100644 --- a/.github/workflows/postgress12_16.yml +++ b/.github/workflows/postgress12_16.yml @@ -181,3 +181,31 @@ jobs: name: Run bash script to verify image postgres:16-dev run: docker pull localhost:5000/postgres:16-dev && docker tag localhost:5000/postgres:16-dev postgres:16-dev && chmod +x ./postgres-16.sh && ./postgres-16.sh + PostgreSQL-17: + runs-on: ubuntu-latest + services: + registry: + image: registry:2 + ports: + - 5000:5000 + steps: + - uses: actions/checkout@v4 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + driver-opts: network=host + - + name: Build and push + uses: docker/build-push-action@v5 + with: + push: true + build-args: POSTGRES_VERSION=17 + file: Dockerfile_alpine + tags: localhost:5000/postgres:dev + - + name: Run bash script to verify image postgres:dev + run: docker pull localhost:5000/postgres:dev && docker tag localhost:5000/postgres:dev postgres:dev && chmod +x ./postgres-1x.sh && ./postgres-1x.sh diff --git a/.gitignore b/.gitignore index 69e6c2a..f6dfe12 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ *.o *.so .vscode +.cache \ No newline at end of file diff --git a/Dockerfile_alpine b/Dockerfile_alpine index daccee8..b467791 100644 --- a/Dockerfile_alpine +++ b/Dockerfile_alpine @@ -1,6 +1,6 @@ ARG POSTGRES_VERSION=16 -FROM postgres:$POSTGRES_VERSION-alpine3.18 as build +FROM postgres:$POSTGRES_VERSION-alpine as build ARG POSTGRES_VERSION=16 RUN apk update && apk add musl-dev icu-dev llvm15-dev clang15 make @@ -13,8 +13,8 @@ COPY pg_cjk_parser--0.0.1.sql /root/parser/ COPY zht2zhs.h /root/parser/ RUN make clean && make install -FROM postgres:$POSTGRES_VERSION-alpine3.18 +FROM postgres:$POSTGRES_VERSION-alpine COPY --from=build /root/parser/pg_cjk_parser.bc /usr/local/lib/postgresql/bitcode -COPY --from=build /root/parser/pg_cjk_parser.so /usr/local/lib/postgresql -COPY --from=build /root/parser/pg_cjk_parser--0.0.1.sql /usr/local/share/postgresql/extension -COPY --from=build /root/parser/pg_cjk_parser.control /usr/local/share/postgresql/extension +COPY --from=build /root/parser/pg_cjk_parser.so /usr/local/lib/postgresql/ +COPY --from=build /root/parser/pg_cjk_parser--0.0.1.sql /usr/local/share/postgresql/extension/ +COPY --from=build /root/parser/pg_cjk_parser.control /usr/local/share/postgresql/extension/ diff --git a/pg_cjk_parser.c b/pg_cjk_parser.c index 7b99662..7dbeaed 100644 --- a/pg_cjk_parser.c +++ b/pg_cjk_parser.c @@ -3006,4 +3006,4 @@ prsd2_zht2zhs(PG_FUNCTION_ARGS) } PG_RETURN_TEXT_P(zhs_text); -} \ No newline at end of file +}