From 58ca27e04e006872eea428c327a90fd92e701a8b Mon Sep 17 00:00:00 2001 From: h0lybyte <5599058+h0lybyte@users.noreply.github.com> Date: Mon, 4 Aug 2025 19:42:26 -0400 Subject: [PATCH] ci(docker): preparing the manual release. --- .../workflows/build-pg17-kilobase-release.yml | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 .github/workflows/build-pg17-kilobase-release.yml diff --git a/.github/workflows/build-pg17-kilobase-release.yml b/.github/workflows/build-pg17-kilobase-release.yml new file mode 100644 index 000000000..18c15048a --- /dev/null +++ b/.github/workflows/build-pg17-kilobase-release.yml @@ -0,0 +1,115 @@ +name: Build PostgreSQL 17 with Kilobase Extension + +on: + workflow_dispatch: + inputs: + tag_name: + description: 'Docker image tag (e.g., 17.4.1.069-kilobase)' + required: true + default: '17.4.1.069-kilobase' + release_name: + description: 'Release name' + required: true + default: 'PostgreSQL 17 with Kilobase Extension' + +permissions: + contents: write + packages: write + id-token: write + +jobs: + build-pg17-image: + runs-on: ubuntu-latest + timeout-minutes: 180 + steps: + - name: Checkout Repo + uses: supabase/postgres/.github/actions/shared-checkout@HEAD + + - uses: DeterminateSystems/nix-installer-action@main + + - run: docker context create builders + + - uses: docker/setup-buildx-action@v3 + with: + endpoint: builders + + - uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Get build args + id: args + run: | + nix run nixpkgs#nushell -- -c ' + open ansible/vars.yml + | items { |key value| {name: $key, item: $value} } + | where { |it| ($it.item | describe) == "string" } + | each { |it| $"($it.name)=($it.item)" } + | str join "\n" + | save --append $env.GITHUB_OUTPUT + ' + + - name: Build and push Docker image + id: build + uses: docker/build-push-action@v5 + with: + push: true + build-args: | + ${{ steps.args.outputs.result }} + target: production + tags: | + ghcr.io/${{ github.repository_owner }}/postgres:${{ inputs.tag_name }} + ghcr.io/${{ github.repository_owner }}/postgres:latest-kilobase + platforms: linux/amd64 + cache-from: type=gha,scope=${{ github.ref_name }}-pg17-kilobase + cache-to: type=gha,mode=max,scope=${{ github.ref_name }}-pg17-kilobase + file: Dockerfile-17 + + - name: Create GitHub Release + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ inputs.tag_name }} + name: ${{ inputs.release_name }} + body: | + ## PostgreSQL 17 Docker Image with Kilobase Extension + + This release contains a complete PostgreSQL 17 Docker image with the kilobase extension included. + + ### Docker Image: + ```bash + docker pull ghcr.io/${{ github.repository_owner }}/postgres:${{ inputs.tag_name }} + ``` + + ### CNPG Cluster Usage: + ```yaml + apiVersion: postgresql.cnpg.io/v1 + kind: Cluster + metadata: + name: postgres-kilobase + spec: + instances: 3 + imageName: ghcr.io/${{ github.repository_owner }}/postgres:${{ inputs.tag_name }} + postgresql: + shared_preload_libraries: + - "pg_stat_statements" + - "pg_failover_slots" + bootstrap: + initdb: + postInitSQL: + - "CREATE EXTENSION IF NOT EXISTS kilobase;" + ``` + + ### Extensions Included: + - kilobase (PostgreSQL extension built with pgrx 0.15.0) + - pg_failover_slots + - All standard Supabase extensions + + ### Build Details: + - PostgreSQL 17 + - Built for: linux/amd64 + - Base: Supabase PostgreSQL distribution + - Built with Nix reproducible builds + draft: false + prerelease: false \ No newline at end of file