@@ -277,7 +277,7 @@ jobs:
277277
278278 postgres-build :
279279 runs-on : ${{ matrix.os }}
280- name : postgresql-${{ matrix.name }}-${{ matrix.arch }} build
280+ name : postgresql${{ matrix.postgres_version }} -${{ matrix.name }}-${{ matrix.arch }} build
281281 timeout-minutes : 15
282282 strategy :
283283 fail-fast : false
@@ -286,15 +286,35 @@ jobs:
286286 - os : ubuntu-22.04
287287 arch : x86_64
288288 name : linux
289+ postgres_version : ' 17'
290+ - os : ubuntu-22.04
291+ arch : x86_64
292+ name : linux
293+ postgres_version : ' 15'
294+ - os : ubuntu-22.04-arm
295+ arch : arm64
296+ name : linux
297+ postgres_version : ' 17'
289298 - os : ubuntu-22.04-arm
290299 arch : arm64
291300 name : linux
301+ postgres_version : ' 15'
292302 - os : macos-15
293303 arch : arm64
294304 name : macos
305+ postgres_version : ' 17'
306+ - os : macos-15
307+ arch : arm64
308+ name : macos
309+ postgres_version : ' 15'
295310 - os : macos-15
296311 arch : x86_64
297312 name : macos
313+ postgres_version : ' 17'
314+ - os : macos-15
315+ arch : x86_64
316+ name : macos
317+ postgres_version : ' 15'
298318 steps :
299319
300320 - uses : actions/checkout@v4.2.2
@@ -307,23 +327,23 @@ jobs:
307327 sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
308328 curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg
309329 sudo apt-get update
310- sudo apt-get install -y postgresql-server-dev-17
330+ sudo apt-get install -y postgresql-server-dev-${{ matrix.postgres_version }}
311331
312332 - name : macos install postgresql
313333 if : matrix.name == 'macos'
314- run : brew install postgresql@17 gettext
334+ run : brew install postgresql@${{ matrix.postgres_version }} gettext
315335
316336 - name : build and package postgresql extension (linux)
317337 if : matrix.name == 'linux'
318- run : make postgres-package
338+ run : make postgres-package PG_CONFIG=/usr/lib/postgresql/${{ matrix.postgres_version }}/bin/pg_config
319339
320340 - name : build and package postgresql extension (macos)
321341 if : matrix.name == 'macos'
322- run : make postgres-package PG_CONFIG=$(brew --prefix postgresql@17 )/bin/pg_config PG_EXTRA_CFLAGS="-I$(brew --prefix gettext)/include ${{ matrix.arch == 'x86_64' && '-arch x86_64' || '' }}"
342+ run : make postgres-package PG_CONFIG=$(brew --prefix postgresql@${{ matrix.postgres_version }} )/bin/pg_config PG_EXTRA_CFLAGS="-I$(brew --prefix gettext)/include ${{ matrix.arch == 'x86_64' && '-arch x86_64' || '' }}"
323343
324344 - uses : actions/upload-artifact@v4.6.2
325345 with :
326- name : cloudsync-postgresql-${{ matrix.name }}-${{ matrix.arch }}
346+ name : cloudsync-postgresql${{ matrix.postgres_version }} -${{ matrix.name }}-${{ matrix.arch }}
327347 path : dist/postgresql/
328348 if-no-files-found : error
329349
@@ -525,6 +545,8 @@ jobs:
525545 [**Expo**](https://www.npmjs.com/package/@sqliteai/sqlite-sync-expo): `npm install @sqliteai/sqlite-sync-expo`
526546 [**Android**](https://central.sonatype.com/artifact/ai.sqlite/sync): `ai.sqlite:sync:${{ steps.tag.outputs.version }}`
527547 [**Swift**](https://github.com/sqliteai/sqlite-sync#swift-package): [Installation Guide](https://github.com/sqliteai/sqlite-sync#swift-package)
548+ [**Docker (PostgreSQL)**](https://hub.docker.com/r/sqlitecloud/sqlite-sync-postgres): `docker pull sqlitecloud/sqlite-sync-postgres:17` or `:15`
549+ [**Docker (Supabase)**](https://hub.docker.com/r/sqlitecloud/sqlite-sync-supabase): `docker pull sqlitecloud/sqlite-sync-supabase:17` or `:15`
528550
529551 ---
530552
@@ -534,3 +556,89 @@ jobs:
534556 cloudsync-*-${{ steps.tag.outputs.version }}.*
535557 CloudSync-*-${{ steps.tag.outputs.version }}.*
536558 make_latest : true
559+
560+ docker-publish :
561+ runs-on : ubuntu-22.04
562+ name : docker ${{ matrix.image }} pg${{ matrix.pg_major }}
563+ needs : [release]
564+ if : github.ref == 'refs/heads/main'
565+
566+ env :
567+ DOCKERHUB_ORG : sqlitecloud
568+
569+ strategy :
570+ fail-fast : false
571+ matrix :
572+ include :
573+ - image : sqlite-sync-postgres
574+ pg_major : ' 17'
575+ dockerfile : docker/postgresql/Dockerfile.release
576+ - image : sqlite-sync-postgres
577+ pg_major : ' 15'
578+ dockerfile : docker/postgresql/Dockerfile.release
579+ - image : sqlite-sync-supabase
580+ pg_major : ' 17'
581+ dockerfile : docker/postgresql/Dockerfile.supabase.release
582+ supabase_tag : ' 17.6.1.071'
583+ - image : sqlite-sync-supabase
584+ pg_major : ' 15'
585+ dockerfile : docker/postgresql/Dockerfile.supabase.release
586+ supabase_tag : ' 15.8.1.085'
587+
588+ steps :
589+
590+ - uses : actions/checkout@v4.2.2
591+ with :
592+ submodules : true
593+
594+ - name : get cloudsync version
595+ id : version
596+ run : echo "version=$(make version)" >> $GITHUB_OUTPUT
597+
598+ - uses : docker/setup-qemu-action@v3
599+
600+ - uses : docker/setup-buildx-action@v3
601+
602+ - uses : docker/login-action@v3
603+ with :
604+ username : ${{ secrets.DOCKERHUB_USERNAME }}
605+ password : ${{ secrets.DOCKERHUB_TOKEN }}
606+
607+ - name : set docker tags and build args (standalone)
608+ if : matrix.image == 'sqlite-sync-postgres'
609+ id : standalone
610+ run : |
611+ VERSION=${{ steps.version.outputs.version }}
612+ PG=${{ matrix.pg_major }}
613+ IMAGE=${{ env.DOCKERHUB_ORG }}/${{ matrix.image }}
614+ {
615+ echo "tags=${IMAGE}:${PG},${IMAGE}:${PG}-${VERSION}"
616+ echo "build_args<<EOF"
617+ echo "POSTGRES_TAG=${PG}"
618+ echo "CLOUDSYNC_VERSION=${VERSION}"
619+ echo "EOF"
620+ } >> $GITHUB_OUTPUT
621+
622+ - name : set docker tags and build args (supabase)
623+ if : matrix.image == 'sqlite-sync-supabase'
624+ id : supabase
625+ run : |
626+ VERSION=${{ steps.version.outputs.version }}
627+ IMAGE=${{ env.DOCKERHUB_ORG }}/${{ matrix.image }}
628+ SUPABASE_TAG=${{ matrix.supabase_tag }}
629+ {
630+ echo "tags=${IMAGE}:${{ matrix.pg_major }},${IMAGE}:${{ matrix.pg_major }}-${VERSION},${IMAGE}:${SUPABASE_TAG}"
631+ echo "build_args<<EOF"
632+ echo "SUPABASE_POSTGRES_TAG=${SUPABASE_TAG}"
633+ echo "CLOUDSYNC_VERSION=${VERSION}"
634+ echo "EOF"
635+ } >> $GITHUB_OUTPUT
636+
637+ - uses : docker/build-push-action@v6
638+ with :
639+ context : .
640+ file : ${{ matrix.dockerfile }}
641+ platforms : linux/amd64,linux/arm64
642+ push : true
643+ tags : ${{ matrix.image == 'sqlite-sync-postgres' && steps.standalone.outputs.tags || steps.supabase.outputs.tags }}
644+ build-args : ${{ matrix.image == 'sqlite-sync-postgres' && steps.standalone.outputs.build_args || steps.supabase.outputs.build_args }}
0 commit comments