Skip to content

Commit 0b26514

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

File tree

1 file changed

+55
-37
lines changed

1 file changed

+55
-37
lines changed

.github/workflows/build_ghcr.yaml

Lines changed: 55 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
@@ -107,10 +110,14 @@ jobs:
107110
mkdir -p /tmp/digests/${{steps.versions.outputs.osver}}-r-${{steps.versions.outputs.rver}}
108111
touch "/tmp/digests/${{steps.versions.outputs.osver}}-r-${{steps.versions.outputs.rver}}/${digest#sha256:}"
109112
113+
- name: Set platform name for artifact
114+
id: platform
115+
run: echo "name=$(echo '${{matrix.platform}}' | sed 's/\//-/g')" >> $GITHUB_OUTPUT
116+
110117
- name: Upload digests
111118
uses: actions/upload-artifact@v4
112119
with:
113-
name: r2udigests-${{matrix.ubuntu}}-${{ github.run_id }}
120+
name: r2udigests-${{matrix.ubuntu}}-${{steps.platform.outputs.name}}-${{github.run_id}}
114121
path: /tmp/digests/**
115122
if-no-files-found: error
116123
retention-days: 1
@@ -125,16 +132,22 @@ jobs:
125132
matrix:
126133
ubuntu: [focal, jammy, noble]
127134
steps:
128-
- name: Download digests
135+
- name: Download amd64 digests
129136
uses: actions/download-artifact@v4
130137
with:
131-
name: r2udigests-${{matrix.ubuntu}}-${{ github.run_id }}
138+
name: r2udigests-${{matrix.ubuntu}}-linux-amd64-${{github.run_id}}
132139
path: /tmp/digests
133140

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

139152
- name: Login to GHCR
140153
uses: docker/login-action@v3
@@ -163,15 +176,20 @@ jobs:
163176
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 ")'
164177
165178
ghcrbuild_ci:
166-
needs: ghcrbuild
179+
needs: merge
167180
strategy:
168181
fail-fast: false
169182
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
183+
include:
184+
- ubuntu: noble_ci
185+
platform: linux/amd64
186+
runner: ubuntu-latest
187+
- ubuntu: noble_ci
188+
platform: linux/arm64
189+
runner: ubuntu-latest-arm64
190+
191+
name: Build ${{ matrix.ubuntu }} (${{ matrix.platform }}) for GHCR
192+
runs-on: ${{ matrix.runner }}
175193
steps:
176194
- name: Checkout
177195
uses: actions/checkout@v4
@@ -189,16 +207,8 @@ jobs:
189207
run: |
190208
echo container=$(echo '${{ steps.meta.outputs.tags }}' | awk -F':' '{print $1}') >> $GITHUB_OUTPUT
191209
192-
- name: Set up QEMU
193-
uses: docker/setup-qemu-action@v3
194-
with:
195-
platforms: arm64
196-
if: contains(matrix.platform, 'arm64')
197-
198210
- name: Set up Docker Buildx
199211
uses: docker/setup-buildx-action@v3
200-
with:
201-
platforms: ${{matrix.platform}}
202212

203213
- name: Login to GHCR
204214
uses: docker/login-action@v3
@@ -224,10 +234,14 @@ jobs:
224234
mkdir -p /tmp/digests/${{matrix.ubuntu}}
225235
touch "/tmp/digests/${{matrix.ubuntu}}/${digest#sha256:}"
226236
237+
- name: Set platform name for artifact
238+
id: platform
239+
run: echo "name=$(echo '${{matrix.platform}}' | sed 's/\//-/g')" >> $GITHUB_OUTPUT
240+
227241
- name: Upload digests
228242
uses: actions/upload-artifact@v4
229243
with:
230-
name: r2udigests-${{matrix.ubuntu}}-${{ github.run_id }}
244+
name: r2udigests-${{matrix.ubuntu}}-${{steps.platform.outputs.name}}-${{github.run_id}}
231245
path: /tmp/digests/**
232246
if-no-files-found: error
233247
retention-days: 1
@@ -242,16 +256,20 @@ jobs:
242256
matrix:
243257
ubuntu: [noble_ci]
244258
steps:
245-
- name: Download digests
259+
- name: Download amd64 digests
246260
uses: actions/download-artifact@v4
247261
with:
248-
name: r2udigests-${{matrix.ubuntu}}-${{ github.run_id }}
262+
name: r2udigests-${{matrix.ubuntu}}-linux-amd64-${{github.run_id}}
263+
path: /tmp/digests
264+
265+
- name: Download arm64 digests
266+
uses: actions/download-artifact@v4
267+
with:
268+
name: r2udigests-${{matrix.ubuntu}}-linux-arm64-${{github.run_id}}
249269
path: /tmp/digests
250270

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

256274
- name: Login to GHCR
257275
uses: docker/login-action@v3

0 commit comments

Comments
 (0)