Skip to content

Commit d17c660

Browse files
committed
More tweaks, and only build arm for noble
1 parent dfffc24 commit d17c660

File tree

1 file changed

+47
-37
lines changed

1 file changed

+47
-37
lines changed

.github/workflows/build_ghcr.yaml

Lines changed: 47 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,22 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
ubuntu: [focal, jammy, noble]
18-
platform: [linux/amd64, linux/arm64]
19-
20-
name: Build container images for GHCR
21-
runs-on: ubuntu-latest
17+
include:
18+
- ubuntu: focal
19+
platform: linux/amd64
20+
runner: ubuntu-latest
21+
- ubuntu: jammy
22+
platform: linux/amd64
23+
runner: ubuntu-latest
24+
- ubuntu: noble
25+
platform: linux/amd64
26+
runner: ubuntu-latest
27+
- ubuntu: noble
28+
platform: linux/arm64
29+
runner: ubuntu-latest-arm64
30+
31+
name: Build ${{ matrix.ubuntu }} (${{ matrix.platform }}) for GHCR
32+
runs-on: ${{ matrix.runner }}
2233
steps:
2334
- name: Checkout
2435
uses: actions/checkout@v4
@@ -36,16 +47,8 @@ jobs:
3647
run: |
3748
echo container=$(echo '${{ steps.meta.outputs.tags }}' | awk -F':' '{print $1}') >> $GITHUB_OUTPUT
3849
39-
- name: Set up QEMU
40-
uses: docker/setup-qemu-action@v3
41-
with:
42-
platforms: arm64
43-
if: contains(matrix.platform, 'arm64')
44-
4550
- name: Set up Docker Buildx
4651
uses: docker/setup-buildx-action@v3
47-
with:
48-
platforms: ${{matrix.platform}}
4952

5053
- name: Login to GHCR
5154
uses: docker/login-action@v3
@@ -110,7 +113,7 @@ jobs:
110113
- name: Upload digests
111114
uses: actions/upload-artifact@v4
112115
with:
113-
name: r2udigests-${{matrix.ubuntu}}-${{ github.run_id }}
116+
name: r2udigests-${{matrix.ubuntu}}-${{replace(matrix.platform, '/', '-')}}-${{github.run_id}}
114117
path: /tmp/digests/**
115118
if-no-files-found: error
116119
retention-days: 1
@@ -125,16 +128,22 @@ jobs:
125128
matrix:
126129
ubuntu: [focal, jammy, noble]
127130
steps:
128-
- name: Download digests
131+
- name: Download amd64 digests
129132
uses: actions/download-artifact@v4
130133
with:
131-
name: r2udigests-${{matrix.ubuntu}}-${{ github.run_id }}
134+
name: r2udigests-${{matrix.ubuntu}}-linux-amd64-${{github.run_id}}
132135
path: /tmp/digests
133136

137+
- name: Download arm64 digests
138+
uses: actions/download-artifact@v4
139+
with:
140+
name: r2udigests-${{matrix.ubuntu}}-linux-arm64-${{github.run_id}}
141+
path: /tmp/digests
142+
continue-on-error: true
143+
if: matrix.ubuntu == 'noble'
144+
134145
- name: Set up Docker Buildx
135146
uses: docker/setup-buildx-action@v3
136-
with:
137-
platforms: ${{matrix.platform}}
138147

139148
- name: Login to GHCR
140149
uses: docker/login-action@v3
@@ -163,15 +172,20 @@ jobs:
163172
cat digestdirs | xargs -i bash -c 'docker buildx imagetools create -t ${{steps.vars.outputs.container}}:{} $(for f in {}/*; do basename "$f"; done | xargs printf "${{steps.vars.outputs.container}}@sha256:%s ")'
164173
165174
ghcrbuild_ci:
166-
needs: ghcrbuild
175+
needs: merge
167176
strategy:
168177
fail-fast: false
169178
matrix:
170-
ubuntu: [noble_ci]
171-
platform: [linux/amd64, linux/arm64]
172-
173-
name: Build CI container images for GHCR
174-
runs-on: ubuntu-latest
179+
include:
180+
- ubuntu: noble_ci
181+
platform: linux/amd64
182+
runner: ubuntu-latest
183+
- ubuntu: noble_ci
184+
platform: linux/arm64
185+
runner: ubuntu-latest-arm64
186+
187+
name: Build ${{ matrix.ubuntu }} (${{ matrix.platform }}) for GHCR
188+
runs-on: ${{ matrix.runner }}
175189
steps:
176190
- name: Checkout
177191
uses: actions/checkout@v4
@@ -189,16 +203,8 @@ jobs:
189203
run: |
190204
echo container=$(echo '${{ steps.meta.outputs.tags }}' | awk -F':' '{print $1}') >> $GITHUB_OUTPUT
191205
192-
- name: Set up QEMU
193-
uses: docker/setup-qemu-action@v3
194-
with:
195-
platforms: arm64
196-
if: contains(matrix.platform, 'arm64')
197-
198206
- name: Set up Docker Buildx
199207
uses: docker/setup-buildx-action@v3
200-
with:
201-
platforms: ${{matrix.platform}}
202208

203209
- name: Login to GHCR
204210
uses: docker/login-action@v3
@@ -227,7 +233,7 @@ jobs:
227233
- name: Upload digests
228234
uses: actions/upload-artifact@v4
229235
with:
230-
name: r2udigests-${{matrix.ubuntu}}-${{ github.run_id }}
236+
name: r2udigests-${{matrix.ubuntu}}-${{replace(matrix.platform, '/', '-')}}-${{github.run_id}}
231237
path: /tmp/digests/**
232238
if-no-files-found: error
233239
retention-days: 1
@@ -242,16 +248,20 @@ jobs:
242248
matrix:
243249
ubuntu: [noble_ci]
244250
steps:
245-
- name: Download digests
251+
- name: Download amd64 digests
246252
uses: actions/download-artifact@v4
247253
with:
248-
name: r2udigests-${{matrix.ubuntu}}-${{ github.run_id }}
254+
name: r2udigests-${{matrix.ubuntu}}-linux-amd64-${{github.run_id}}
255+
path: /tmp/digests
256+
257+
- name: Download arm64 digests
258+
uses: actions/download-artifact@v4
259+
with:
260+
name: r2udigests-${{matrix.ubuntu}}-linux-arm64-${{github.run_id}}
249261
path: /tmp/digests
250262

251263
- name: Set up Docker Buildx
252264
uses: docker/setup-buildx-action@v3
253-
with:
254-
platforms: ${{matrix.platform}}
255265

256266
- name: Login to GHCR
257267
uses: docker/login-action@v3

0 commit comments

Comments
 (0)