|
15 | 15 | jobs: |
16 | 16 | docker: |
17 | 17 | name: Build Docker |
18 | | - runs-on: ubuntu-24.04 |
19 | 18 | strategy: |
20 | 19 | matrix: |
21 | 20 | postgres: ["14", "15", "16", "17"] |
| 21 | + runner: ["ubuntu-24.04", "ubuntu-24.04-arm"] |
22 | 22 |
|
| 23 | + runs-on: ${{ matrix.runner }} |
| 24 | + |
| 25 | + env: |
| 26 | + BUILDKIT_PROGRESS: plain |
| 27 | + POSTGRES_VERSION: ${{ matrix.postgres }} |
23 | 28 | steps: |
24 | 29 | - name: Login to Docker Hub |
25 | 30 | uses: docker/login-action@v3 |
26 | 31 | with: |
27 | 32 | username: pgduckdb |
28 | 33 | password: ${{ secrets.DOCKERHUB_TOKEN }} |
| 34 | + |
29 | 35 | - name: Checkout pg_duckdb extension code |
30 | 36 | uses: actions/checkout@v4 |
31 | 37 | with: |
32 | 38 | submodules: "recursive" |
33 | | - - name: Set env |
| 39 | + - name: Compute platform |
| 40 | + id: compute_platform |
34 | 41 | run: | |
35 | | - echo "POSTGRES_VERSION=${{ matrix.postgres }}" >> $GITHUB_ENV |
| 42 | + # Set platform depending on which runner we're using |
| 43 | + if [ "${{ matrix.runner }}" = "ubuntu-24.04" ]; then |
| 44 | + echo "platform=amd64" >> "$GITHUB_OUTPUT" |
| 45 | + else |
| 46 | + echo "platform=arm64" >> "$GITHUB_OUTPUT" |
| 47 | + fi |
| 48 | +
|
36 | 49 | - name: Set up QEMU |
37 | 50 | uses: docker/setup-qemu-action@v3 |
| 51 | + |
38 | 52 | - name: Set up Docker buildx |
39 | 53 | uses: docker/setup-buildx-action@v3 |
40 | 54 | with: |
41 | | - platforms: linux/amd64,linux/arm64 |
| 55 | + platforms: linux/${{ steps.compute_platform.outputs.platform }} |
| 56 | + |
42 | 57 | - name: docker bake |
43 | 58 | uses: docker/bake-action@v5 |
44 | 59 | with: |
45 | 60 | targets: pg_duckdb_${{ matrix.postgres }} |
46 | 61 | push: true |
47 | 62 | set: | |
48 | | - *.platform=linux/amd64,linux/arm64 |
| 63 | + *.platform=linux/${{ steps.compute_platform.outputs.platform }} |
49 | 64 | *.cache-to=type=gha,mode=max |
50 | 65 | *.cache-from=type=gha |
51 | | - postgres.tags=pgduckdb/pgduckdb:${{ matrix.postgres }}-${{ github.sha }} |
52 | | - ${{ !contains(github.ref_name, '/') && format('postgres.tags=pgduckdb/pgduckdb:{0}-{1}', matrix.postgres, github.ref_name) || '' }} |
| 66 | + postgres.tags=pgduckdb/pgduckdb:${{ matrix.postgres }}-${{ steps.compute_platform.outputs.platform }}-${{ github.sha }} |
| 67 | + ${{ !contains(github.ref_name, '/') && format('postgres.tags=pgduckdb/pgduckdb:{0}-${1}-{2}', matrix.postgres, steps.compute_platform.outputs.platform, github.ref_name) || '' }} |
0 commit comments