Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 22 additions & 7 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,38 +15,53 @@ on:
jobs:
docker:
name: Build Docker
runs-on: ubuntu-24.04
strategy:
matrix:
postgres: ["14", "15", "16", "17"]
runner: ["ubuntu-24.04", "ubuntu-24.04-arm"]

runs-on: ${{ matrix.runner }}

env:
BUILDKIT_PROGRESS: plain
POSTGRES_VERSION: ${{ matrix.postgres }}
steps:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: pgduckdb
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Checkout pg_duckdb extension code
uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Set env
- name: Compute platform
id: compute_platform
run: |
echo "POSTGRES_VERSION=${{ matrix.postgres }}" >> $GITHUB_ENV
# Set platform depending on which runner we're using
if [ "${{ matrix.runner }}" = "ubuntu-24.04" ]; then
echo "platform=amd64" >> "$GITHUB_OUTPUT"
else
echo "platform=arm64" >> "$GITHUB_OUTPUT"
fi

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64
platforms: linux/${{ steps.compute_platform.outputs.platform }}

- name: docker bake
uses: docker/bake-action@v5
with:
targets: pg_duckdb_${{ matrix.postgres }}
push: true
set: |
*.platform=linux/amd64,linux/arm64
*.platform=linux/${{ steps.compute_platform.outputs.platform }}
*.cache-to=type=gha,mode=max
*.cache-from=type=gha
postgres.tags=pgduckdb/pgduckdb:${{ matrix.postgres }}-${{ github.sha }}
${{ !contains(github.ref_name, '/') && format('postgres.tags=pgduckdb/pgduckdb:{0}-{1}', matrix.postgres, github.ref_name) || '' }}
postgres.tags=pgduckdb/pgduckdb:${{ matrix.postgres }}-${{ steps.compute_platform.outputs.platform }}-${{ github.sha }}
${{ !contains(github.ref_name, '/') && format('postgres.tags=pgduckdb/pgduckdb:{0}-${1}-{2}', matrix.postgres, steps.compute_platform.outputs.platform, github.ref_name) || '' }}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ USER postgres
# Selectively copy the files that we need. Sadly we need separate COPY commands
# for each directory, because docker puts only the contents of the source
# directory into the target directory, and not the directory itself too.
COPY --chown=postgres:postgres Makefile Makefile.global pg_duckdb.control .
COPY --chown=postgres:postgres Makefile Makefile.global pg_duckdb.control ./
COPY --chown=postgres:postgres .git/modules/third_party/duckdb/HEAD .git/modules/third_party/duckdb/HEAD
COPY --chown=postgres:postgres sql sql
COPY --chown=postgres:postgres src src
Expand Down