From 92e05b6d2e3f15e5438710a7e2a1212014f7d481 Mon Sep 17 00:00:00 2001 From: t3hmrman Date: Tue, 5 Mar 2024 17:59:44 +0000 Subject: [PATCH] release: pg_idkit 0.2.3 Signed-off-by: GitHub --- .../workflows/build-and-test-gnu/action.yaml | 2 +- .github/workflows/build-rpm/action.yaml | 2 +- .github/workflows/container.yaml | 2 +- .github/workflows/release.yaml | 4 +- CHANGELOG | 20 +++++++++ Cargo.lock | 2 +- Cargo.toml | 14 +++--- README.md | 12 ++--- .../base-pkg-alpine3.18-amd64.Dockerfile | 2 +- ...g_idkit-pg15.5-alpine3.18-amd64.Dockerfile | 2 +- ...g_idkit-pg15.6-alpine3.18-amd64.Dockerfile | 45 +++++++++++++++++++ ...g_idkit-pg16.1-alpine3.18-amd64.Dockerfile | 8 ++-- ...g_idkit-pg16.2-alpine3.18-amd64.Dockerfile | 45 +++++++++++++++++++ 13 files changed, 135 insertions(+), 25 deletions(-) create mode 100644 infra/docker/pg_idkit-pg15.6-alpine3.18-amd64.Dockerfile create mode 100644 infra/docker/pg_idkit-pg16.2-alpine3.18-amd64.Dockerfile diff --git a/.github/workflows/build-and-test-gnu/action.yaml b/.github/workflows/build-and-test-gnu/action.yaml index 75378d6..434822c 100644 --- a/.github/workflows/build-and-test-gnu/action.yaml +++ b/.github/workflows/build-and-test-gnu/action.yaml @@ -49,7 +49,7 @@ inputs: type: string default: 16.2 decription: | - Postgres version (ex. '15.5, '16.2') + Postgres version (ex. '15.6, '16.2') outputs: {} runs: using: "composite" diff --git a/.github/workflows/build-rpm/action.yaml b/.github/workflows/build-rpm/action.yaml index 4b352a2..928f978 100644 --- a/.github/workflows/build-rpm/action.yaml +++ b/.github/workflows/build-rpm/action.yaml @@ -28,7 +28,7 @@ inputs: type: string default: 16.2 decription: | - Postgres version (ex. '15.5, '16.2') + Postgres version (ex. '15.6, '16.2') user: type: string default: runner diff --git a/.github/workflows/container.yaml b/.github/workflows/container.yaml index fdf0644..9f583af 100644 --- a/.github/workflows/container.yaml +++ b/.github/workflows/container.yaml @@ -23,7 +23,7 @@ jobs: runner: ubuntu-22.04 container: arch: amd64 - pg_version: 15.5 + pg_version: 15.6 os_version: alpine3.18 - triple: x86_64-unknown-linux-musl gh: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c2cbff0..1b9efa7 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -18,7 +18,7 @@ jobs: - pgrx: pg-version: pg15 pg: - version: 15.5 + version: 15.6 - pgrx: pg-version: pg16 pg: @@ -43,7 +43,7 @@ jobs: - pgrx: pg-version: pg15 pg: - version: 15.5 + version: 15.6 - pgrx: pg-version: pg16 pg: diff --git a/CHANGELOG b/CHANGELOG index c700e24..873fc7c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,26 @@ # Changelog All notable changes to this project will be documented in this file. +## [0.2.3] - 2024-03-06 + +### Bug Fixes + +- Release tagging upon merge +- Use --locked for cargo install +- Use zsh for better cross-platform support +- More zsh usage +- Use builder-gnu image from CI +- Cross platform shell usage by platform + +### Features + +- Require superuser in pg_idkit.control ("Ability to install the extension for non-root users") + +### Miscellaneous Tasks + +- Update Rust to 1.76.0 +- Update postgres 16 to v16.2 + ## [0.2.2] - 2024-01-30 ### Bug Fixes diff --git a/Cargo.lock b/Cargo.lock index 1832114..f041261 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1253,7 +1253,7 @@ dependencies = [ [[package]] name = "pg_idkit" -version = "0.2.2" +version = "0.2.3" dependencies = [ "base36", "chrono", diff --git a/Cargo.toml b/Cargo.toml index b581357..3656b5d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pg_idkit" -version = "0.2.2" +version = "0.2.3" edition = "2021" authors = ["Victor Adossi "] license = "MIT" @@ -65,7 +65,7 @@ assets = [] [package.metadata.generate-rpm.variants.pg11] assets = [ { source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/lib/postgresql/pg_idkit.so", dest = "/usr/lib64/pgsql/pg_idkit.so", mode = "755" }, - { source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/share/postgresql/extension/pg_idkit--0.2.2.sql", dest = "/usr/share/pgsql/extension/pg_idkit--0.2.2.sql", mode = "755" }, + { source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/share/postgresql/extension/pg_idkit--0.2.3.sql", dest = "/usr/share/pgsql/extension/pg_idkit--0.2.3.sql", mode = "755" }, { source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/share/postgresql/extension/pg_idkit.control", dest = "/usr/share/pgsql/extension/pg_idkit.control", mode = "755" }, ] requires = { postgresql-server = "> 11", glibc = "*" } @@ -74,7 +74,7 @@ release = "pg11" [package.metadata.generate-rpm.variants.pg12] assets = [ { source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/lib/postgresql/pg_idkit.so", dest = "/usr/lib64/pgsql/pg_idkit.so", mode = "755" }, - { source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/share/postgresql/extension/pg_idkit--0.2.2.sql", dest = "/usr/share/pgsql/extension/pg_idkit--0.2.2.sql", mode = "755" }, + { source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/share/postgresql/extension/pg_idkit--0.2.3.sql", dest = "/usr/share/pgsql/extension/pg_idkit--0.2.3.sql", mode = "755" }, { source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/share/postgresql/extension/pg_idkit.control", dest = "/usr/share/pgsql/extension/pg_idkit.control", mode = "755" }, ] requires = { postgresql-server = "> 12", glibc = "*" } @@ -83,7 +83,7 @@ release = "pg12" [package.metadata.generate-rpm.variants.pg13] assets = [ { source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/lib/postgresql/pg_idkit.so", dest = "/usr/lib64/pgsql/pg_idkit.so", mode = "755" }, - { source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/share/postgresql/extension/pg_idkit--0.2.2.sql", dest = "/usr/share/pgsql/extension/pg_idkit--0.2.2.sql", mode = "755" }, + { source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/share/postgresql/extension/pg_idkit--0.2.3.sql", dest = "/usr/share/pgsql/extension/pg_idkit--0.2.3.sql", mode = "755" }, { source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/share/postgresql/extension/pg_idkit.control", dest = "/usr/share/pgsql/extension/pg_idkit.control", mode = "755" }, ] requires = { postgresql-server = "> 13", glibc = "*" } @@ -92,7 +92,7 @@ release = "pg13" [package.metadata.generate-rpm.variants.pg14] assets = [ { source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/lib/postgresql/pg_idkit.so", dest = "/usr/lib64/pgsql/pg_idkit.so", mode = "755" }, - { source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/share/postgresql/extension/pg_idkit--0.2.2.sql", dest = "/usr/share/pgsql/extension/pg_idkit--0.2.2.sql", mode = "755" }, + { source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/share/postgresql/extension/pg_idkit--0.2.3.sql", dest = "/usr/share/pgsql/extension/pg_idkit--0.2.3.sql", mode = "755" }, { source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/share/postgresql/extension/pg_idkit.control", dest = "/usr/share/pgsql/extension/pg_idkit.control", mode = "755" }, ] requires = { postgresql-server = "> 14", glibc = "*" } @@ -101,7 +101,7 @@ release = "pg14" [package.metadata.generate-rpm.variants.pg15] assets = [ { source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/lib/postgresql/pg_idkit.so", dest = "/usr/lib64/pgsql/pg_idkit.so", mode = "755" }, - { source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/share/postgresql/extension/pg_idkit--0.2.2.sql", dest = "/usr/share/pgsql/extension/pg_idkit--0.2.2.sql", mode = "755" }, + { source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/share/postgresql/extension/pg_idkit--0.2.3.sql", dest = "/usr/share/pgsql/extension/pg_idkit--0.2.3.sql", mode = "755" }, { source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/share/postgresql/extension/pg_idkit.control", dest = "/usr/share/pgsql/extension/pg_idkit.control", mode = "755" }, ] requires = { postgresql-server = "> 15", glibc = "*" } @@ -110,7 +110,7 @@ release = "pg15" [package.metadata.generate-rpm.variants.pg16] assets = [ { source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/lib/postgresql/pg_idkit.so", dest = "/usr/lib64/pgsql/pg_idkit.so", mode = "755" }, - { source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/share/postgresql/extension/pg_idkit--0.2.2.sql", dest = "/usr/share/pgsql/extension/pg_idkit--0.2.2.sql", mode = "755" }, + { source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/share/postgresql/extension/pg_idkit--0.2.3.sql", dest = "/usr/share/pgsql/extension/pg_idkit--0.2.3.sql", mode = "755" }, { source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/share/postgresql/extension/pg_idkit.control", dest = "/usr/share/pgsql/extension/pg_idkit.control", mode = "755" }, ] requires = { postgresql-server = "> 16", glibc = "*" } diff --git a/README.md b/README.md index be26bbe..332cb32 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ docker run \ -e POSTGRES_PASSWORD=replace_this \ -p 5432 \ --name pg_idkit \ - ghcr.io/vadosware/pg_idkit:0.2.2-pg16.2-alpine3.18-amd64 + ghcr.io/vadosware/pg_idkit:0.2.3-pg16.2-alpine3.18-amd64 ``` > [!WARNING] @@ -119,7 +119,7 @@ target/release/pg_idkit-pg16 │   └── share │   └── postgresql │   └── extension -│   ├── pg_idkit--0.2.2.sql +│   ├── pg_idkit--0.2.3.sql │   └── pg_idkit.control └── usr ├── lib @@ -138,7 +138,7 @@ As the installation of the extension into a specific version of postgres uses yo In the example above, the [files you need for a Postgres extension][pg-ext-files] are: - `target/release/home//.pgrx/16.2/pgrx-install/lib/postgresql/pg_idkit.so` -- `target/release/home//.pgrx/16.2/pgrx-install/share/postgresql/extension/pg_idkit--0.2.2.sql` +- `target/release/home//.pgrx/16.2/pgrx-install/share/postgresql/extension/pg_idkit--0.2.3.sql` - `target/release/home//.pgrx/16.2/pgrx-install/share/postgresql/extension/pg_idkit.control` Install these files in the relevant folders for your Postgres installation -- note that exactly where these files should go can can differ across linux distributions and containerized environments. @@ -185,7 +185,7 @@ docker run \ -e POSTGRES_PASSWORD=replace_this \ -p 5432 \ --name pg_idkit \ - ghcr.io/vadosware/pg_idkit:0.2.2-pg16.2-alpine3.18-amd64 + ghcr.io/vadosware/pg_idkit:0.2.3-pg16.2-alpine3.18-amd64 ``` From another terminal, you can exec into the `pg_idkit` container and enable `pg_idkit`: @@ -222,10 +222,10 @@ RPMs are produced upon [every official release](/releases) of `pg_idkit`. Grab a released version of the RPM (or build one yourself by running `just build-rpm` after [setting up local development][guide-localdev]). -For example, with an RPM named `pg_idkit-0.2.2-pg16.x86_64.rpm`, you should be able to run: +For example, with an RPM named `pg_idkit-0.2.3-pg16.x86_64.rpm`, you should be able to run: ``` -dnf install pg_idkit-0.2.2-pg16.x86_64.rpm +dnf install pg_idkit-0.2.3-pg16.x86_64.rpm ``` diff --git a/infra/docker/base-pkg-alpine3.18-amd64.Dockerfile b/infra/docker/base-pkg-alpine3.18-amd64.Dockerfile index 5848d36..74ff921 100644 --- a/infra/docker/base-pkg-alpine3.18-amd64.Dockerfile +++ b/infra/docker/base-pkg-alpine3.18-amd64.Dockerfile @@ -1,7 +1,7 @@ FROM alpine:3.19.0@sha256:13b7e62e8df80264dbb747995705a986aa530415763a6c58f84a3ca8af9a5bcd AS builder # Allow for overriding rust toolcahin version -ARG RUST_TOOLCHAIN_VERSION=1.74 +ARG RUST_TOOLCHAIN_VERSION=1.76 ENV RUST_TOOLCHAIN_VERSION=$RUST_TOOLCHAIN_VERSION # Allow for overriding of PGRX PG version that is used diff --git a/infra/docker/pg_idkit-pg15.5-alpine3.18-amd64.Dockerfile b/infra/docker/pg_idkit-pg15.5-alpine3.18-amd64.Dockerfile index defb8e4..1e4a938 100644 --- a/infra/docker/pg_idkit-pg15.5-alpine3.18-amd64.Dockerfile +++ b/infra/docker/pg_idkit-pg15.5-alpine3.18-amd64.Dockerfile @@ -12,7 +12,7 @@ ENV USER=$USER ARG PGRX_PG_VERSION=pg15 ENV PGRX_PG_VERSION=$PGRX_PG_VERSION -ARG PKG_PG_VERSION=15.5 +ARG PKG_PG_VERSION=15.6 ENV PKG_PG_VERSION=$PKG_PG_VERSION ENV PKG_TARBALL_SUFFIX="-musl" diff --git a/infra/docker/pg_idkit-pg15.6-alpine3.18-amd64.Dockerfile b/infra/docker/pg_idkit-pg15.6-alpine3.18-amd64.Dockerfile new file mode 100644 index 0000000..506a6c4 --- /dev/null +++ b/infra/docker/pg_idkit-pg15.6-alpine3.18-amd64.Dockerfile @@ -0,0 +1,45 @@ +# +# NOTE: you must have the base packaging layer built for this image to work +# you can build this from scratch with `just build-base-pkg-image` +# +# `cargo pgrx init` is run in the base-pkg, so it contains the versions of pg that will be used. +# +FROM ghcr.io/vadosware/pg_idkit/base-pkg:0.1.x-alpine3.18-amd64 AS builder + +ARG USER +ENV USER=$USER + +ARG PGRX_PG_VERSION=pg15 +ENV PGRX_PG_VERSION=$PGRX_PG_VERSION + +ARG PKG_PG_VERSION=15.6 +ENV PKG_PG_VERSION=$PKG_PG_VERSION + +ENV PKG_TARBALL_SUFFIX="-musl" + +# Re-run the build with the latest code +WORKDIR /pg_idkit +COPY . . +RUN RUSTFLAGS="-Ctarget-feature=-crt-static" just build package + +FROM postgres:15.6-alpine3.18@sha256:cee29a99808ad95f0e23685b84e641c4a0ab40278b09ee0c98883e24c4c89459 + +# NOTE: PGRX_PG_VERSION is defined via base-pkg:pg15.6-alpine3.18-amd64 +ARG PGRX_PG_VERSION=pg15 +ARG PGIDKIT_VERSION +ARG PGIDKIT_REVISION + +# Install packaged pg_idkit for system postgres +COPY --from=builder /pg_idkit/pg_idkit-*-musl.tar.gz /tmp +RUN tar -C /usr/local --strip-components=1 -xvf /tmp/pg_idkit-*-musl.tar.gz + +LABEL org.opencontainers.image.authors="Victor Adossi " +LABEL org.opencontainers.image.description="A distribution of the base postgres image, with pg_idkit pre-installed." +LABEL org.opencontainers.image.documentation="https://github.com/VADOSWARE/pg_idkit#readme" +LABEL org.opencontainers.image.licenses="Apache-2.0" +LABEL org.opencontainers.image.revision=$PGIDKIT_REVISION +LABEL org.opencontainers.image.source="https://github.com/VADOSWARE/pg_idkit" +LABEL org.opencontainers.image.title="Postgres + pg_idkit" +LABEL org.opencontainers.image.url="https://github.com/VADOSWARE/pg_idkit" +LABEL org.opencontainers.image.vendor="VADOSWARE" +LABEL org.opencontainers.image.version=v${PGIDKIT_VERSION} diff --git a/infra/docker/pg_idkit-pg16.1-alpine3.18-amd64.Dockerfile b/infra/docker/pg_idkit-pg16.1-alpine3.18-amd64.Dockerfile index 8644e0e..8c79120 100644 --- a/infra/docker/pg_idkit-pg16.1-alpine3.18-amd64.Dockerfile +++ b/infra/docker/pg_idkit-pg16.1-alpine3.18-amd64.Dockerfile @@ -10,7 +10,7 @@ ENV USER=$USER ARG PGRX_PG_VERSION=pg16 ENV PGRX_PG_VERSION=$PGRX_PG_VERSION -ARG PKG_PG_VERSION=16.2 +ARG PKG_PG_VERSION=16.1 ENV PKG_PG_VERSION=$PKG_PG_VERSION ENV PKG_TARBALL_SUFFIX="-musl" @@ -20,9 +20,9 @@ WORKDIR /pg_idkit COPY . . RUN RUSTFLAGS="-Ctarget-feature=-crt-static" just build package -FROM postgres:16.2-alpine3.18@sha256:7301126f8f27879e950feac65f148bb191007d6cd9b9a4a3a949ff85f7adca44 +FROM postgres:16.1-alpine3.18@sha256:a44705e05d7c52add276c29d355851c63b8ce7df764191095c7337848bc2d69b -# NOTE: PGRX_PG_VERSION is defined via base-pkg:pg16.2-alpine3.18-amd64 +# NOTE: PGRX_PG_VERSION is defined via base-pkg:pg16.1-alpine3.18-amd64 ARG PGRX_PG_VERSION=pg16 ENV PGRX_PG_VERSION=$PGRX_PG_VERSION @@ -42,4 +42,4 @@ LABEL org.opencontainers.image.source="https://github.com/VADOSWARE/pg_idkit" LABEL org.opencontainers.image.title="Postgres + pg_idkit" LABEL org.opencontainers.image.url="https://github.com/VADOSWARE/pg_idkit" LABEL org.opencontainers.image.vendor="VADOSWARE" -LABEL org.opencontainers.image.version=v${PGIDKIT_VERSION} +LABEL org.opencontainers.image.version=v${PGIDKIT_VERSION} \ No newline at end of file diff --git a/infra/docker/pg_idkit-pg16.2-alpine3.18-amd64.Dockerfile b/infra/docker/pg_idkit-pg16.2-alpine3.18-amd64.Dockerfile new file mode 100644 index 0000000..8644e0e --- /dev/null +++ b/infra/docker/pg_idkit-pg16.2-alpine3.18-amd64.Dockerfile @@ -0,0 +1,45 @@ +# +# NOTE: you must have the base packaging layer built for this image to work +# you can build this from scratch with `just build-base-pkg-image` +# +FROM ghcr.io/vadosware/pg_idkit/base-pkg:0.1.x-alpine3.18-amd64 AS builder + +ARG USER +ENV USER=$USER + +ARG PGRX_PG_VERSION=pg16 +ENV PGRX_PG_VERSION=$PGRX_PG_VERSION + +ARG PKG_PG_VERSION=16.2 +ENV PKG_PG_VERSION=$PKG_PG_VERSION + +ENV PKG_TARBALL_SUFFIX="-musl" + +# Re-run the build with the latest code +WORKDIR /pg_idkit +COPY . . +RUN RUSTFLAGS="-Ctarget-feature=-crt-static" just build package + +FROM postgres:16.2-alpine3.18@sha256:7301126f8f27879e950feac65f148bb191007d6cd9b9a4a3a949ff85f7adca44 + +# NOTE: PGRX_PG_VERSION is defined via base-pkg:pg16.2-alpine3.18-amd64 +ARG PGRX_PG_VERSION=pg16 +ENV PGRX_PG_VERSION=$PGRX_PG_VERSION + +# Install packaged pg_idkit for system postgres +COPY --from=builder /pg_idkit/pg_idkit-*-musl.tar.gz /tmp +RUN tar -C /usr/local --strip-components=1 -xvf /tmp/pg_idkit-*-musl.tar.gz + +ARG PGIDKIT_VERSION +ARG PGIDKIT_REVISION + +LABEL org.opencontainers.image.authors="Victor Adossi " +LABEL org.opencontainers.image.description="A distribution of the base postgres image, with pg_idkit pre-installed." +LABEL org.opencontainers.image.documentation="https://github.com/VADOSWARE/pg_idkit#readme" +LABEL org.opencontainers.image.licenses="Apache-2.0" +LABEL org.opencontainers.image.revision=${PGIDKIT_REVISION} +LABEL org.opencontainers.image.source="https://github.com/VADOSWARE/pg_idkit" +LABEL org.opencontainers.image.title="Postgres + pg_idkit" +LABEL org.opencontainers.image.url="https://github.com/VADOSWARE/pg_idkit" +LABEL org.opencontainers.image.vendor="VADOSWARE" +LABEL org.opencontainers.image.version=v${PGIDKIT_VERSION}