|
18 | 18 | workflow_dispatch:
|
19 | 19 |
|
20 | 20 | jobs:
|
21 |
| - build: |
22 |
| - runs-on: [self-hosted, X64] |
| 21 | + build: |
| 22 | + strategy: |
| 23 | + matrix: |
| 24 | + include: |
| 25 | + - runner: arm-runner |
| 26 | + arch: arm64 |
| 27 | + ubuntu: focal |
| 28 | + mcpu: neoverse-n1 |
| 29 | + runs-on: ${{ matrix.runner }} |
23 | 30 | timeout-minutes: 150
|
24 | 31 | permissions:
|
25 | 32 | contents: write
|
|
28 | 35 |
|
29 | 36 | steps:
|
30 | 37 | - name: Checkout Repo
|
31 |
| - uses: actions/checkout@v2 |
| 38 | + uses: actions/checkout@v3 |
32 | 39 |
|
| 40 | + - id: args |
| 41 | + uses: mikefarah/yq@master |
| 42 | + with: |
| 43 | + cmd: yq 'to_entries | map(select(.value|type == "!!str")) | map(.key + "=" + .value) | join("\n")' 'ansible/vars.yml' |
| 44 | + - run: docker context create builders |
| 45 | + - uses: docker/setup-buildx-action@v2 |
| 46 | + with: |
| 47 | + endpoint: builders |
| 48 | + - uses: docker/build-push-action@v3 |
| 49 | + with: |
| 50 | + push: false |
| 51 | + load: true |
| 52 | + build-args: | |
| 53 | + ${{ steps.args.outputs.result }} |
| 54 | + target: extensions |
| 55 | + tags: supabase/postgres:extensions |
| 56 | + platforms: linux/${{ matrix.arch }} |
| 57 | + cache-from: type=gha |
| 58 | + cache-to: type=gha,mode=max |
| 59 | + - name: Extract built packages |
| 60 | + run: | |
| 61 | + mkdir -p /tmp/extensions ansible/files/extensions |
| 62 | + docker save supabase/postgres:extensions | tar xv -C /tmp/extensions |
| 63 | + for layer in /tmp/extensions/*/layer.tar; do |
| 64 | + tar xvf "$layer" -C ansible/files/extensions --strip-components 1 |
| 65 | + done |
| 66 | +
|
| 67 | + - id: version |
| 68 | + run: echo "${{ steps.args.outputs.result }}" | grep "postgresql" >> "$GITHUB_OUTPUT" |
| 69 | + - name: Build Postgres deb |
| 70 | + uses: docker/build-push-action@v3 |
| 71 | + with: |
| 72 | + push: false |
| 73 | + load: true |
| 74 | + file: docker/Dockerfile |
| 75 | + target: pg-deb |
| 76 | + build-args: | |
| 77 | + ubuntu_release=${{ matrix.ubuntu }} |
| 78 | + postgresql_major=${{ steps.version.outputs.postgresql_major }} |
| 79 | + postgresql_release=${{ steps.version.outputs.postgresql_release }} |
| 80 | + CPPFLAGS=-mcpu=${{ matrix.mcpu }} |
| 81 | + tags: supabase/postgres:deb |
| 82 | + platforms: linux/${{ matrix.arch }} |
| 83 | + cache-from: type=gha |
| 84 | + cache-to: type=gha,mode=max |
| 85 | + - name: Extract Postgres deb |
| 86 | + run: | |
| 87 | + mkdir -p /tmp/build ansible/files/postgres |
| 88 | + docker save supabase/postgres:deb | tar xv -C /tmp/build |
| 89 | + for layer in /tmp/build/*/layer.tar; do |
| 90 | + tar xvf "$layer" -C ansible/files/postgres --strip-components 1 |
| 91 | + done |
33 | 92 | - name: Build AMI
|
34 | 93 | run: |
|
35 | 94 | GIT_SHA=${{github.sha}}
|
|
0 commit comments