diff --git a/.github/workflows/base-pkg-image.yml b/.github/workflows/base-pkg-image.yml deleted file mode 100644 index ce58c074..00000000 --- a/.github/workflows/base-pkg-image.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: base-pkg-image - -description: | - Build (and push) the base-pkg image - -on: - workflow_dispatch: - inputs: - cargo-pgrx-version: - required: false - type: string - default: "0.13.1" - description: | - version of cargo-pgrx to download (inside image build) - -concurrency: - group: pg_idkit # Project-wide - cancel-in-progress: true - -permissions: - contents: none - -jobs: - build-and-push-builder-image: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3 - - - name: Log in to GHCR - uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build base-pkg image - env: - BUILDER_IMAGE_ARG_CARGO_PGRX_VERSION: ${{ inputs.cargo-pgrx-version }} - run: | - just build-base-pkg-image - - - name: Push base-pkg image - run: | - just push-base-pkg-image diff --git a/.github/workflows/build-and-test/action.yaml b/.github/workflows/build-and-test/action.yaml index e57c9758..f2330de9 100644 --- a/.github/workflows/build-and-test/action.yaml +++ b/.github/workflows/build-and-test/action.yaml @@ -47,9 +47,9 @@ inputs: default: idkit cargo-pgrx-version: type: string - default: 0.13.1 + default: 0.14.1 decription: | - cargo-pgrx version (ex. '0.13.1') + cargo-pgrx version (ex. '0.14.1') pgrx-pg-version: type: string default: pg17 diff --git a/.github/workflows/build-rpm/action.yaml b/.github/workflows/build-rpm/action.yaml index 725ab6d4..a4351f0f 100644 --- a/.github/workflows/build-rpm/action.yaml +++ b/.github/workflows/build-rpm/action.yaml @@ -33,9 +33,9 @@ inputs: Postgres version (ex. '17.4') cargo-pgrx-version: type: string - default: 0.13.1 + default: 0.14.1 decription: | - cargo-pgrx version (ex. '0.13.1) + cargo-pgrx version (ex. '0.14.1) user: type: string default: runner diff --git a/.github/workflows/ci-builder-image.yml b/.github/workflows/ci-builder-image.yml deleted file mode 100644 index ffe59335..00000000 --- a/.github/workflows/ci-builder-image.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: ci-builder-image - -description: | - Build (and push) the CI builder image - -on: - workflow_dispatch: - inputs: - cargo-pgrx-version: - required: false - type: string - default: "0.13.1" - description: | - version of cargo-pgrx to download (inside image build) - -concurrency: - group: pg_idkit # Project-wide - cancel-in-progress: true - -permissions: - contents: none - -jobs: - builder-image: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - strategy: - matrix: - libc: - - gnu - - musl - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3 - - - name: Log in to GHCR - uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build builder image - env: - BUILDER_TYPE: ${{ matrix.libc }} - BUILDER_IMAGE_ARG_CARGO_PGRX_VERSION: ${{ inputs.cargo-pgrx-version }} - run: | - just build-builder-image - - - name: Push builder image - env: - BUILDER_TYPE: ${{ matrix.libc }} - run: | - just push-builder-image diff --git a/.github/workflows/container.yaml b/.github/workflows/container.yaml deleted file mode 100644 index d08af049..00000000 --- a/.github/workflows/container.yaml +++ /dev/null @@ -1,75 +0,0 @@ -name: container - -on: - push: - branches: - # Run on auto-generated release PRs - - prep-release-v[0-9]+\.[0-9]+\.[0-9]+ - tags: - - v[0-9]+\.[0-9]+\.[0-9]+ - -jobs: - build: - permissions: - contents: read - packages: write - runs-on: ${{ matrix.config.gh.runner }} - strategy: - matrix: - config: - - triple: x86_64-unknown-linux-musl - gh: - runner: ubuntu-22.04 - container: - arch: amd64 - pgrx_pg_version: pg15 - pg_version: "15.12" - os_version: alpine3.21.3 - - triple: x86_64-unknown-linux-musl - gh: - runner: ubuntu-22.04 - container: - arch: amd64 - pgrx_pg_version: pg16 - pg_version: "16.8" - os_version: alpine3.21.3 - - triple: x86_64-unknown-linux-musl - gh: - runner: ubuntu-22.04 - container: - arch: amd64 - pgrx_pg_version: pg17 - pg_version: "17.4" - os_version: alpine3.21.3 - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: docker/setup-qemu-action@v3 - - uses: taiki-e/install-action@v2 - with: - tool: cargo-get,just - - - name: Registry login - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build container image (prerelease) - if: ${{ startsWith(github.ref, 'refs/heads/prep-release') }} - run: just build-image push-image - env: - CONTAINER_IMAGE_ARCH: ${{ matrix.config.container.arch }} - PGRX_PG_VERSION: ${{ matrix.config.container.pgrx_pg_version }} - POSTGRES_IMAGE_VERSION: ${{ matrix.config.container.pg_version }} - POSTGRES_OS_IMAGE_VERSION: ${{ matrix.config.container.os_version }} - PGIDKIT_IMAGE_TAG_SUFFIX: "-prerelease" - - - name: Build container image - if: ${{ startsWith(github.ref, 'refs/tags/v') }} - run: just build-image push-image - env: - CONTAINER_IMAGE_ARCH: ${{ matrix.config.container.arch }} - PGRX_PG_VERSION: ${{ matrix.config.container.pgrx_pg_version }} - POSTGRES_IMAGE_VERSION: ${{ matrix.config.container.pg_version }} - POSTGRES_OS_IMAGE_VERSION: ${{ matrix.config.container.os_version }} diff --git a/.github/workflows/create-release-pr.yaml b/.github/workflows/create-release-pr.yaml deleted file mode 100644 index 4d7bb673..00000000 --- a/.github/workflows/create-release-pr.yaml +++ /dev/null @@ -1,99 +0,0 @@ -name: create-release-pr - -on: - workflow_dispatch: - inputs: - version: - description: Version to release (ex. `0.1.0`) - required: false - type: string - -concurrency: - group: pg_idkit-create-release-pr # Project-wide - cancel-in-progress: true - -jobs: - create-release-pr: - permissions: - id-token: write - pull-requests: write - contents: write - runs-on: ubuntu-latest - steps: - # Checkout the full repository history - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - fetch-depth: 0 - - # Set up caching - - uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8 - - # Install deps - - uses: chainguard-dev/actions/setup-gitsign@main - - name: Install cargo-release - uses: taiki-e/cache-cargo-install-action@4d586f211d9b0bca9e7b59e57e2a0febf36c0929 # v2.1.1 - with: - tool: cargo-release - - name: Install just - uses: taiki-e/cache-cargo-install-action@4d586f211d9b0bca9e7b59e57e2a0febf36c0929 # v2.1.1 - with: - tool: just - - name: Install cargo-get - uses: taiki-e/cache-cargo-install-action@4d586f211d9b0bca9e7b59e57e2a0febf36c0929 # v2.1.1 - with: - tool: cargo-get - - name: Install git-cliff - uses: taiki-e/cache-cargo-install-action@4d586f211d9b0bca9e7b59e57e2a0febf36c0929 # v2.1.1 - with: - tool: git-cliff - - name: Install cargo-edit - uses: taiki-e/cache-cargo-install-action@4d586f211d9b0bca9e7b59e57e2a0febf36c0929 # v2.1.1 - with: - tool: cargo-edit - - # Prep the new version - - name: Detect version (current or input) - id: detect-version - run: | - if [ -z "${{ inputs.version || '' }}" ]; then - echo value=$(just print-version) >> $GITHUB_OUTPUT; - else - echo value="${{ inputs.version }}" >> $GITHUB_OUTPUT; - fi - - name: Set version - env: - VERSION: ${{ steps.detect-version.outputs.value }} - run: | - just set-version $VERSION - - name: Generate Changelog - env: - VERSION: ${{ steps.detect-version.outputs.value }} - run: | - just changelog - - # Create PR for release - - uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8 - with: - token: ${{ secrets.RELEASE_PR_PAT }} - signoff: true - commit-message: | - release: pg_idkit ${{ steps.detect-version.outputs.value }} - title: | - release: pg_idkit v${{ steps.detect-version.outputs.value }} - body: | - This is a release prep branch for `pg_idkit` release v${{ steps.detect-version.outputs.value }}. - - Upon merging, this branch will cause a tag to be placed on the commit in `main`. After the tag has been placed, a build will run that generates artifacts and publishes a release. - - Before this release is ready, here is the checklist: - - [ ] Update `README.md` to use the newest version of Postgres, if it has changed (ex. `16.2` -> `17.0`) - - [ ] Update `README.md` to soon-to-be-released pg_idkit (ex. `pg_idkit-0.2.0` -> `pg_idkit-0.2.1`) - - [ ] Update `generate-rpm` configuration in `Cargo.toml` version references (ex. `--0.2.0.sql` -> `--0.2.1.sql`) - - [ ] Update default version in `justfile - - See CHANGELOG for changes made to this release before it goes out. - labels: | - release-pr - assignees: | - t3hmrman - branch: prep-release-v${{ steps.detect-version.outputs.value }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 8846a793..6ccd05f1 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -15,25 +15,28 @@ on: - main # Run on auto-generated release PRs - prep-release-v[0-9]+\.[0-9]+\.[0-9]+ + - fix(ci)=release-zip-build # TODO: remove tags: # Run on released tags (created by automated post-merge release-tagging), to generate the actual release - v[0-9]+\.[0-9]+\.[0-9]+ +concurrency: + group: release + jobs: build-rpm: runs-on: ubuntu-latest - if: ${{ startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/heads/prep-release-v') }} strategy: matrix: config: - - pgrx: - pg-version: pg15 - pg: - version: "15.12" - - pgrx: - pg-version: pg16 - pg: - version: "16.8" + # - pgrx: + # pg-version: pg15 + # pg: + # version: "15.12" + # - pgrx: + # pg-version: pg16 + # pg: + # version: "16.8" - pgrx: pg-version: pg17 pg: @@ -50,7 +53,6 @@ jobs: build-zip: runs-on: ubuntu-latest - if: ${{ startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/heads/prep-release-v') }} container: image: ghcr.io/vadosware/pg_idkit/builder-${{ matrix.libc }}:0.1.x strategy: @@ -59,14 +61,14 @@ jobs: - gnu - musl config: - - pgrx: - pg-version: pg15 - pg: - version: "15.12" - - pgrx: - pg-version: pg16 - pg: - version: "16.8" + # - pgrx: + # pg-version: pg15 + # pg: + # version: "15.12" + # - pgrx: + # pg-version: pg16 + # pg: + # version: "16.8" - pgrx: pg-version: pg17 pg: @@ -78,19 +80,71 @@ jobs: uses: ./.github/workflows/build-and-test with: libc: ${{ matrix.libc }} - artifact-upload: ${{ startsWith(github.ref, 'refs/tags/v') }} + artifact-upload: true artifact-tarball-suffix: "-${{ matrix.config.pgrx.pg-version }}-${{ matrix.libc }}" pgrx-pg-version: ${{ matrix.config.pgrx.pg-version }} pkg-pg-version: ${{ matrix.config.pg.version }} + test-rpm: + runs-on: ubuntu-latest + needs: + - build-rpm + steps: + - uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1 + with: + path: pg_idkit-*.rpm + + test-zip: + runs-on: ubuntu-latest + needs: + - build-zip + strategy: + matrix: + pg: + - version: 17.5 + version-major: 17 + steps: + + - name: Install postgres version ${{ matrix.pg.version }} + run: | + apt update + DEBIAN_FRONTEND=noninteractive apt install -y postgresql-common + /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -i -v ${{ matrix.pg.version-major }} + apt install -y postgresql-17 + + - uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1 + with: + path: pg_idkit-*.tar.gz + + - name: Install pg_idkit + run: | + mkdir /tmp/install + mv pg_idkit-*.tar.gz /tmp/install + cd /tmp/install + tar -xvf pg_idkit*.tar.gz --strip-components=1 + chmod a+rwx lib/postgresql/*.so + cp lib/postgresql/*.so $(pg_config --pkglibdir) + chmod a+rwx share/postgresql/extension/* + cp share/postgresql/extension/*.sql $(pg_config --sharedir)/extension + cp share/postgresql/extension/*.control $(pg_config --sharedir)/extension + + - name: Start the db + run: | + echo < test.bash + export PATH=/usr/lib/postgresql/17/bin:$PATH + pg_ctl initdb -D ~/pg + pg_ctl -D ~/pg -l ~/pg/log start + psql -c "CREATE EXTENSION pg_idkit; SELECT idkit_uuidv7_generate();" + EOF + su postgres -c test.bash + release: runs-on: ubuntu-latest - if: ${{ startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/heads/prep-release-v') }} permissions: contents: write needs: - - build-rpm - - build-zip + - test-rpm + - test-zip steps: # Checkout the repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -104,8 +158,8 @@ jobs: - name: Create release uses: softprops/action-gh-release@v1 with: - prerelease: ${{ startsWith(github.ref, 'refs/heads/prep-release') }} - draft: ${{ startsWith(github.ref, 'refs/heads/prep-release') }} + prerelease: true + draft: true tag_name: ${{ github.ref_name || inputs.version }} # NOTE: while we have the CHANGELOG file, it always contains *all* changes, # so we will use the generated GitHub commits for now diff --git a/.github/workflows/tag-release.yaml b/.github/workflows/tag-release.yaml deleted file mode 100644 index e05ca37d..00000000 --- a/.github/workflows/tag-release.yaml +++ /dev/null @@ -1,44 +0,0 @@ -name: tag-release - -on: - pull_request: - types: - - closed - branches: - - 'prep-release-v**' - workflow_dispatch: - inputs: - ref: - description: | - Github ref (e.x. 'branch', 'tag-v1.0.0', '') - required: false - default: '' - type: string - -jobs: - ## Tag a release - tag-release: - runs-on: ubuntu-latest - if: ${{ github.event_name == 'workflow_dispatch' || github.event.pull_request.merged }} - permissions: - contents: write - steps: - # Checkout the repository - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - token: ${{ secrets.RELEASE_PR_PAT }} - fetch-depth: 0 - ref: ${{ github.event.inputs.ref || github.event.pull_request.head.ref }} - - # Install deps - - uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8 - - - uses: cargo-bins/cargo-binstall@main - - name: install cargo deps - run: | - cargo binstall -y --locked just cargo-get - - - name: Create and push new tag - run: | - git tag v$(just print-version); - git push https://${{ secrets.RELEASE_PR_PAT }}@github.com/VADOSWARE/pg_idkit.git --tags; diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml deleted file mode 100644 index 756ae3c2..00000000 --- a/.github/workflows/test.yaml +++ /dev/null @@ -1,81 +0,0 @@ -name: test - -on: - merge_group: - pull_request: - - push: - tags-ignore: - - "v[0-9]+.[0-9]+.[0-9]+" - - "v[0-9]+.[0-9]+.[0-9]+*" - -concurrency: - group: pr-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - test-gnu: - runs-on: ubuntu-latest - container: - image: ghcr.io/vadosware/pg_idkit/builder-gnu:0.1.x - strategy: - matrix: - config: - - rpm: - arch: x86_64 - pgrx: - pgrx-pg-version: pg15 - pkg-pg-version: 15.12 - - rpm: - arch: x86_64 - pgrx: - pgrx-pg-version: pg16 - pkg-pg-version: 16.8 - - rpm: - arch: x86_64 - pgrx: - pgrx-pg-version: pg17 - pkg-pg-version: 17.4 - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - - name: Build & test the project - uses: ./.github/workflows/build-and-test - with: - libc: gnu - pkg-pg-version: ${{ matrix.config.pgrx.pkg-pg-version }} - pgrx-pg-version: ${{ matrix.config.pgrx.pgrx-pg-version }} - artifact-upload: false - - test-musl: - runs-on: ubuntu-latest - container: - image: ghcr.io/vadosware/pg_idkit/builder-musl:0.1.x - strategy: - matrix: - config: - - rpm: - arch: x86_64 - pgrx: - pgrx-pg-version: pg15 - pkg-pg-version: 15.12 - - rpm: - arch: x86_64 - pgrx: - pgrx-pg-version: pg16 - pkg-pg-version: 16.8 - - rpm: - arch: x86_64 - pgrx: - pgrx-pg-version: pg17 - pkg-pg-version: 17.4 - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - - name: Build & test the project - uses: ./.github/workflows/build-and-test - with: - libc: musl - pkg-pg-version: ${{ matrix.config.pgrx.pkg-pg-version }} - pgrx-pg-version: ${{ matrix.config.pgrx.pgrx-pg-version }} - artifact-upload: false diff --git a/Cargo.toml b/Cargo.toml index 30763422..9c583e6b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,7 +36,7 @@ getrandom = { version = "0.2" } chrono = { version = "0.4", default-features = false, features = ["clock"] } svix-ksuid = { version = "0.8" } nanoid = { version = "0.4" } -pgrx = { version = "=0.13.1" } +pgrx = { version = "=0.14.1" } pushid = { version = "0.0.1" } timeflake-rs = { version = "0.3" } ulid = { version = "1.1", features = [ "uuid" ] } @@ -45,7 +45,7 @@ xid = { version = "1.1" } time = { version = "0.3" } [dev-dependencies] -pgrx-tests = { version = "=0.13.1" } +pgrx-tests = { version = "=0.14.1" } [profile.dev] panic = "unwind" diff --git a/Justfile b/Justfile index f269e2c9..d4defa25 100644 --- a/Justfile +++ b/Justfile @@ -241,7 +241,7 @@ builder_image_name := env_var_or_default("BUILDER_IMAGE_NAME", "ghcr.io/vadoswar builder_image_tag := env_var_or_default("BUILDER_IMAGE_TAG", "0.1.x") builder_image_name_full := env_var_or_default("BUILDER_IMAGE_NAME_FULL", builder_image_name + ":" + builder_image_tag) -builder_image_arg_cargo_pgrx_version := env_var_or_default("BUILDER_IMAGE_ARG_CARGO_PGRX_VERSION", "0.13.1") +builder_image_arg_cargo_pgrx_version := env_var_or_default("BUILDER_IMAGE_ARG_CARGO_PGRX_VERSION", "0.14.1") # Build the docker image used in BUILDER [group('package')] diff --git a/docs/local-development.md b/docs/local-development.md index a38b4f35..0578af22 100644 --- a/docs/local-development.md +++ b/docs/local-development.md @@ -30,7 +30,7 @@ The PGRX project is the magic behind this extension, exposing an easy-to-program To install it: ```console -cargo install --locked cargo-pgrx@0.13.1 +cargo install --locked cargo-pgrx@0.14.1 cargo pgrx init ``` diff --git a/infra/docker/base-pkg-alpine3.21.3-amd64.Dockerfile b/infra/docker/base-pkg-alpine3.21.3-amd64.Dockerfile index b3f63d1e..0a443e4c 100644 --- a/infra/docker/base-pkg-alpine3.21.3-amd64.Dockerfile +++ b/infra/docker/base-pkg-alpine3.21.3-amd64.Dockerfile @@ -41,7 +41,7 @@ RUN cargo install just cargo-get # Install pgrx # (disabling the static C runtime is required since pgrx requires dynamic linking w/ libssl and libcrypto) -RUN RUSTFLAGS="-Ctarget-feature=-crt-static" cargo install --locked cargo-pgrx@0.13.1 +RUN RUSTFLAGS="-Ctarget-feature=-crt-static" cargo install --locked cargo-pgrx@0.14.1 # Copy in pg_idkit code WORKDIR /pg_idkit diff --git a/infra/docker/builder-gnu.Dockerfile b/infra/docker/builder-gnu.Dockerfile index ad43b645..3fb588db 100644 --- a/infra/docker/builder-gnu.Dockerfile +++ b/infra/docker/builder-gnu.Dockerfile @@ -1,7 +1,7 @@ # rust:1.85.1-slim-bullseye as of 2025/03/27 FROM rust:1.85.1-slim-bullseye@sha256:1eca9af45f393ac4669b9b63659529638359575f6268cbd4e6543ddc46c53803 -ARG CARGO_PGRX_VERSION=0.13.1 +ARG CARGO_PGRX_VERSION=0.14.1 ENV CARGO_PGRX_VERSION=${CARGO_PGRX_VERSION} ENV CARGO_HOME=/usr/local/cargo diff --git a/infra/docker/builder-musl.Dockerfile b/infra/docker/builder-musl.Dockerfile index 24e03d09..37ef45a2 100644 --- a/infra/docker/builder-musl.Dockerfile +++ b/infra/docker/builder-musl.Dockerfile @@ -12,7 +12,7 @@ RUN cargo install sccache --locked --features=openssl/vendored # rust:1.85.1-alpine3.21 as of 2025/03/31 FROM rust:1.85.1-alpine3.21@sha256:4333721398de61f53ccbe53b0b855bcc4bb49e55828e8f652d7a8ac33dd0c118 -ARG CARGO_PGRX_VERSION=0.13.1 +ARG CARGO_PGRX_VERSION=0.14.1 ENV CARGO_PGRX_VERSION=${CARGO_PGRX_VERSION} ENV CARGO_HOME=/usr/local/cargo diff --git a/secrets/docker/password.secret b/secrets/docker/password.secret index 40024911..6d460345 100644 Binary files a/secrets/docker/password.secret and b/secrets/docker/password.secret differ