From 2d78ff97939cc8f7abfb5a97eb751e240e03963a Mon Sep 17 00:00:00 2001 From: vados Date: Wed, 21 May 2025 13:34:33 +0900 Subject: [PATCH 01/12] fix(ci): release zip file building --- .github/workflows/release.yaml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 8846a793..156729bd 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -83,14 +83,28 @@ jobs: pgrx-pg-version: ${{ matrix.config.pgrx.pg-version }} pkg-pg-version: ${{ matrix.config.pg.version }} + test-rpm: + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1 + with: + path: pg_idkit-*.rpm + + test-zip: + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1 + with: + path: pg_idkit-*.tar.gz + 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 From ae551ecb61ad97934b4de574e15d7b9c690101f1 Mon Sep 17 00:00:00 2001 From: vados Date: Wed, 21 May 2025 13:34:55 +0900 Subject: [PATCH 02/12] debug(ci): run release flow, disable other tests --- .github/workflows/base-pkg-image.yml | 48 ------------ .github/workflows/ci-builder-image.yml | 56 -------------- .github/workflows/container.yaml | 75 ------------------ .github/workflows/create-release-pr.yaml | 99 ------------------------ .github/workflows/release.yaml | 1 + .github/workflows/tag-release.yaml | 44 ----------- .github/workflows/test.yaml | 81 ------------------- 7 files changed, 1 insertion(+), 403 deletions(-) delete mode 100644 .github/workflows/base-pkg-image.yml delete mode 100644 .github/workflows/ci-builder-image.yml delete mode 100644 .github/workflows/container.yaml delete mode 100644 .github/workflows/create-release-pr.yaml delete mode 100644 .github/workflows/tag-release.yaml delete mode 100644 .github/workflows/test.yaml 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/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 156729bd..dd882845 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -15,6 +15,7 @@ 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]+ 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 From 63bf9fa3d27f1139d7b9c40acee4e5c5099d865d Mon Sep 17 00:00:00 2001 From: vados Date: Wed, 21 May 2025 13:42:31 +0900 Subject: [PATCH 03/12] debug(ci): run release workflow --- .github/workflows/release.yaml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index dd882845..f179670f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -23,7 +23,6 @@ on: 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: @@ -51,7 +50,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: @@ -100,7 +98,6 @@ jobs: release: runs-on: ubuntu-latest - if: ${{ startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/heads/prep-release-v') }} permissions: contents: write needs: @@ -119,8 +116,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 From 6d01d5aefaa9f6712b9aa870b55b4144c3e16df9 Mon Sep 17 00:00:00 2001 From: vados Date: Wed, 21 May 2025 13:43:18 +0900 Subject: [PATCH 04/12] debug(ci): only run latest pg --- .github/workflows/release.yaml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f179670f..0acb2995 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -26,14 +26,14 @@ jobs: 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: @@ -58,14 +58,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: From 6cda8bd9f7371e934ef73fb29372579143c9b7b0 Mon Sep 17 00:00:00 2001 From: vados Date: Wed, 21 May 2025 13:44:51 +0900 Subject: [PATCH 05/12] feat(ci): limit concurrency on release build --- .github/workflows/release.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0acb2995..19390c62 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -20,6 +20,9 @@ on: # 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 From a73a5aa0ae23d4b516d9359cdabcb39fcc313796 Mon Sep 17 00:00:00 2001 From: vados Date: Wed, 21 May 2025 13:49:03 +0900 Subject: [PATCH 06/12] fix(ci): ensure test-(rpm|zip) depends on build-(rpm|zip) --- .github/workflows/release.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 19390c62..189720f4 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -87,6 +87,8 @@ jobs: test-rpm: runs-on: ubuntu-latest + needs: + - build-rpm steps: - uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1 with: @@ -94,6 +96,8 @@ jobs: test-zip: runs-on: ubuntu-latest + needs: + - build-zip steps: - uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1 with: From c0913b77951762f3bf35b1079f8b5e1bf34f81db Mon Sep 17 00:00:00 2001 From: vados Date: Wed, 21 May 2025 14:02:59 +0900 Subject: [PATCH 07/12] debug(ci): always upload --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 189720f4..980739e9 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -80,7 +80,7 @@ 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 }} From 79421dce85359ff9bb30869774c673991e6c76b5 Mon Sep 17 00:00:00 2001 From: vados Date: Wed, 21 May 2025 15:34:05 +0900 Subject: [PATCH 08/12] wip: add TODO --- .github/workflows/release.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 980739e9..9b889334 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -102,6 +102,34 @@ jobs: - uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1 with: path: pg_idkit-*.tar.gz + # TODO: + # + # 1. tar -xvf pg_idkit + # + # 2. install postgres (by verison) + # apt install -y postgresql-common + # /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -i -v 17 + # apt install -y postgres-17 + # export PATH=/usr/lib/postgresql/17/bin:$PATH + # + # 3. install the extension from zip file + # (unzip to current directory?) + # pg_config --sharedir (.sql, .control files go here) + # pg_config --pkglibdir (shared objects for extensions go here) + # cd pg_idkit-0.3.0 + # 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 + # + # 4. Start the db + # su postgres + # export PATH=/usr/lib/postgresql/17/bin:$PATH + # pg_ctl initdb -D ~/pg + # pg_ctl -D ~/pg -l ~/pg/log start + # (look for DB start in logs?) + # psql -e "CREATE EXTENSION pg_idkit; SELECT idkit_uuidv7_generate();" release: runs-on: ubuntu-latest From 05345236e3d3be3f6a58cbf4313be81ef1260ae2 Mon Sep 17 00:00:00 2001 From: vados Date: Wed, 21 May 2025 15:49:33 +0900 Subject: [PATCH 09/12] fix: instructions Signed-off-by: vados --- .github/workflows/release.yaml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 9b889334..0ae0d56a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -104,17 +104,16 @@ jobs: path: pg_idkit-*.tar.gz # TODO: # - # 1. tar -xvf pg_idkit + # 1. tar -xvf pg_idkit*.tar.gz --strip-components=1 # # 2. install postgres (by verison) - # apt install -y postgresql-common - # /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -i -v 17 - # apt install -y postgres-17 - # export PATH=/usr/lib/postgresql/17/bin:$PATH + # export PG_VERSION_NUM=17 + # DEBIAN_FRONTEND=noninteractive apt install -y postgresql-common + # /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -i -v $PG_VERSION_NUM + # apt install -y postgresql-17 # # 3. install the extension from zip file # (unzip to current directory?) - # pg_config --sharedir (.sql, .control files go here) # pg_config --pkglibdir (shared objects for extensions go here) # cd pg_idkit-0.3.0 # chmod a+rwx lib/postgresql/*.so @@ -129,7 +128,7 @@ jobs: # pg_ctl initdb -D ~/pg # pg_ctl -D ~/pg -l ~/pg/log start # (look for DB start in logs?) - # psql -e "CREATE EXTENSION pg_idkit; SELECT idkit_uuidv7_generate();" + # psql -c "CREATE EXTENSION pg_idkit; SELECT idkit_uuidv7_generate();" release: runs-on: ubuntu-latest From f56c164c8d9c45c15163cf51c20c8fd823c33bac Mon Sep 17 00:00:00 2001 From: vados Date: Wed, 21 May 2025 16:08:15 +0900 Subject: [PATCH 10/12] feat(ci): add basic test for built zip package Signed-off-by: vados --- .github/workflows/release.yaml | 62 +++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 27 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0ae0d56a..6ccd05f1 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -98,37 +98,45 @@ jobs: 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 - # TODO: - # - # 1. tar -xvf pg_idkit*.tar.gz --strip-components=1 - # - # 2. install postgres (by verison) - # export PG_VERSION_NUM=17 - # DEBIAN_FRONTEND=noninteractive apt install -y postgresql-common - # /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -i -v $PG_VERSION_NUM - # apt install -y postgresql-17 - # - # 3. install the extension from zip file - # (unzip to current directory?) - # pg_config --pkglibdir (shared objects for extensions go here) - # cd pg_idkit-0.3.0 - # 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 - # - # 4. Start the db - # su postgres - # export PATH=/usr/lib/postgresql/17/bin:$PATH - # pg_ctl initdb -D ~/pg - # pg_ctl -D ~/pg -l ~/pg/log start - # (look for DB start in logs?) - # psql -c "CREATE EXTENSION pg_idkit; SELECT idkit_uuidv7_generate();" + + - 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 From eb6e6f7f1b8e0fb2749fcd683dbb7133ec3d6f78 Mon Sep 17 00:00:00 2001 From: vados Date: Wed, 21 May 2025 16:23:15 +0900 Subject: [PATCH 11/12] chore(secrets): update docker pass Signed-off-by: vados --- secrets/docker/password.secret | Bin 63 -> 63 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/secrets/docker/password.secret b/secrets/docker/password.secret index 4002491165035d7da53408aa2bcef9d04104002d..6d4603458e7be9d8d4c9f6c4c50a13658cde3342 100644 GIT binary patch literal 63 zcmV-F0KoqMM@dveQdv+`0N=RfD-1LVBXSWR9EKo)VivhVBb^i`@~wiag5T_L!AxNU VGpNl32kYpLwRR_Yu(2~ps~XnC8CL)R literal 63 zcmV-F0KoqMM@dveQdv+`05u2kY~FRjZu1}xe61VbvF5q7vPg=^5D5l=D;aR!g^>k8 Vob~xZd5|J!opug% Date: Wed, 21 May 2025 16:24:09 +0900 Subject: [PATCH 12/12] chore: update pgrx to 0.14.1 Signed-off-by: vados --- .github/workflows/build-and-test/action.yaml | 4 ++-- .github/workflows/build-rpm/action.yaml | 4 ++-- Cargo.toml | 4 ++-- Justfile | 2 +- docs/local-development.md | 2 +- infra/docker/base-pkg-alpine3.21.3-amd64.Dockerfile | 2 +- infra/docker/builder-gnu.Dockerfile | 2 +- infra/docker/builder-musl.Dockerfile | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) 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/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