Skip to content

Commit 0969f55

Browse files
committed
ci: attempt to build image natively without QEMU
1 parent 03e2cb8 commit 0969f55

File tree

1 file changed

+50
-6
lines changed

1 file changed

+50
-6
lines changed

.github/workflows/ci.yaml

Lines changed: 50 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
publish:
3131
if: github.repository == 'tsuru/platforms' && github.event_name != 'pull_request'
3232
needs: test
33-
runs-on: ubuntu-24.04
33+
runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
3434
strategy:
3535
fail-fast: false
3636
matrix:
@@ -47,6 +47,9 @@ jobs:
4747
- ruby
4848
- scratch
4949
- static
50+
arch:
51+
- amd64
52+
- arm64
5053
steps:
5154
- uses: actions/checkout@v4
5255
- uses: docker/login-action@v3
@@ -59,16 +62,14 @@ jobs:
5962
img="tsuru/${{ matrix.platform }}"
6063
tags=""
6164
if [[ ${ref} == "master" ]] || [[ ${ref} == "main" ]]; then
62-
tags="${img}:latest"
65+
tags="${img}:latest-${{ matrix.arch }}"
6366
elif [[ ${ref} =~ ^${{ matrix.platform }}-([0-9.]+)$ ]]; then
64-
tags=${img}:${BASH_REMATCH[1]},${img}:latest
67+
tags=${img}:${BASH_REMATCH[1]}-${{ matrix.arch }},${img}:latest-${{ matrix.arch }}
6568
fi
6669
echo "::set-output name=tag::${tags}"
6770
if: github.event_name != 'pull_request'
6871
id: tags
6972
shell: bash
70-
- name: Set up QEMU
71-
uses: docker/setup-qemu-action@v3
7273
- name: Set up Docker Buildx
7374
uses: docker/setup-buildx-action@v3
7475
- uses: docker/build-push-action@v5
@@ -77,4 +78,47 @@ jobs:
7778
context: ./${{ matrix.platform }}
7879
push: true
7980
tags: ${{ steps.tags.outputs.tag }}
80-
platforms: linux/amd64,linux/arm64
81+
platforms: linux/${{ matrix.arch }}
82+
manifest:
83+
if: github.repository == 'tsuru/platforms' && github.event_name != 'pull_request'
84+
needs: publish
85+
runs-on: ubuntu-24.04
86+
strategy:
87+
fail-fast: false
88+
matrix:
89+
platform:
90+
- ballerina
91+
- buildpack
92+
- go
93+
- java
94+
- lua
95+
- nodejs
96+
- perl
97+
- php
98+
- python
99+
- ruby
100+
- scratch
101+
- static
102+
steps:
103+
- uses: actions/checkout@v4
104+
- uses: docker/login-action@v3
105+
with:
106+
username: ${{ secrets.DOCKERHUB_USERNAME }}
107+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
108+
- run: |
109+
ref="${GITHUB_REF##*/}"
110+
img="tsuru/${{ matrix.platform }}"
111+
if [[ ${ref} == "master" ]] || [[ ${ref} == "main" ]]; then
112+
docker buildx imagetools create -t ${img}:latest \
113+
${img}:latest-amd64 \
114+
${img}:latest-arm64
115+
elif [[ ${ref} =~ ^${{ matrix.platform }}-([0-9.]+)$ ]]; then
116+
version=${BASH_REMATCH[1]}
117+
docker buildx imagetools create -t ${img}:${version} \
118+
${img}:${version}-amd64 \
119+
${img}:${version}-arm64
120+
docker buildx imagetools create -t ${img}:latest \
121+
${img}:latest-amd64 \
122+
${img}:latest-arm64
123+
fi
124+
shell: bash

0 commit comments

Comments
 (0)