23
23
jobs :
24
24
build :
25
25
name : " Build: ${{ matrix.version }}/${{ matrix.arch }}"
26
- runs-on : ubuntu-20 .04
26
+ runs-on : ubuntu-22 .04
27
27
28
28
strategy :
29
29
fail-fast : false # Don't cancel other jobs if one fails
59
59
steps :
60
60
-
61
61
name : Checkout
62
- uses : actions/checkout@v2
62
+ uses : actions/checkout@v4
63
63
-
64
64
name : Environment variables
65
65
run : |
@@ -70,18 +70,18 @@ jobs:
70
70
echo ARM64_HOST_SSH_CERT="$(ssh-keyscan -t rsa ${{ secrets.ARM64_HOST }} 2>/dev/null)" | tee -a ${GITHUB_ENV}
71
71
-
72
72
name : Set up QEMU
73
- uses : docker/setup-qemu-action@v1
73
+ uses : docker/setup-qemu-action@v3
74
74
-
75
75
name : Set up Docker Buildx
76
- uses : docker/setup-buildx-action@v1
76
+ uses : docker/setup-buildx-action@v3
77
77
-
78
78
name : Check Docker
79
79
run : |
80
80
docker version
81
81
docker info
82
82
-
83
83
name : Login to Docker Hub
84
- uses : docker/login-action@v1
84
+ uses : docker/login-action@v3
85
85
with :
86
86
username : ${{ secrets.DOCKERHUB_USERNAME }}
87
87
password : ${{ secrets.DOCKERHUB_TOKEN }}
91
91
-
92
92
# Build and cache image in the registry
93
93
name : Build image
94
- uses : docker/build-push-action@v2
94
+ uses : docker/build-push-action@v5
95
95
with :
96
96
context : ${{ env.BUILD_DIR }}
97
97
file : ${{ env.BUILD_DIR }}/Dockerfile
@@ -103,13 +103,22 @@ jobs:
103
103
# Push intermediate arch-specific build tag to repo
104
104
tags : ${{ env.BUILD_IMAGE_TAG }}-${{ env.GIT_SHA7 }}-${{ env.ARCH }}
105
105
push : ${{ github.event_name != 'pull_request' }} # Don't push for PRs
106
+ # Disable automatic image attestations
107
+ # With image attestations enabled, the image tag pushed to the registry is a manifest list.
108
+ # That makes it impossible to stitch different platform images together in a manifest list, since you
109
+ # cannot have a manifest list of manifest lists.
110
+ # See https://docs.docker.com/build/attestations/attestation-storage/
111
+ # TODO: Refactor to allow for image attestations
112
+ provenance : false
113
+ sbom : false
106
114
# BUILD_IMAGE_TAG - persistent multi-arch tag, updated at the end of the build (success or failure)
107
- cache-from : type=registry,ref=${{ env.BUILD_IMAGE_TAG }}
108
- cache-to : type=inline # Write the cache metadata into the image configuration
115
+ # Use registry cache with max mode to cahce all image layers in the registry
116
+ cache-from : type=registry,ref=${{ env.BUILD_IMAGE_TAG }}-cache-${{ env.ARCH }}
117
+ cache-to : type=registry,ref=${{ env.BUILD_IMAGE_TAG }}-cache-${{ env.ARCH }},mode=max
109
118
110
119
test :
111
120
name : " Test: ${{ matrix.version }}/${{ matrix.arch }}"
112
- runs-on : ubuntu-20 .04
121
+ runs-on : ubuntu-22 .04
113
122
needs : build
114
123
115
124
strategy :
@@ -134,12 +143,10 @@ jobs:
134
143
steps :
135
144
-
136
145
name : Setup Bats
137
- uses : mig4/setup-bats@v1
138
- with :
139
- bats-version : " 1.3.0"
146
+ uses : bats-core/bats-action@2.0.0
140
147
-
141
148
name : Checkout
142
- uses : actions/checkout@v2
149
+ uses : actions/checkout@v4
143
150
-
144
151
name : Environment variables
145
152
run : |
@@ -181,14 +188,16 @@ jobs:
181
188
# Dynamic variable names cannot be used when mapping step outputs to job outputs.
182
189
# Step outputs cannot be accessed directly from other jobs. Dead end.
183
190
- name : Store test results
184
- uses : actions/upload-artifact@v2
191
+ uses : actions/upload-artifact@v4
185
192
with :
186
- name : test-results
193
+ name : test-results-${{ env.GIT_SHA7 }}-${{ env.VERSION_PREFIX }}${{ env.VERSION }}-${{ env.ARCH }}
187
194
path : ${{ github.workspace }}/test-results-*.txt
195
+ if-no-files-found : error
196
+ overwrite : true
188
197
189
198
push :
190
199
name : " Push: ${{ matrix.version }}/multi"
191
- runs-on : ubuntu-20 .04
200
+ runs-on : ubuntu-22 .04
192
201
193
202
# Wait for test to either succeed or fail
194
203
needs : test
@@ -208,7 +217,7 @@ jobs:
208
217
steps :
209
218
-
210
219
name : Checkout
211
- uses : actions/checkout@v2
220
+ uses : actions/checkout@v4
212
221
-
213
222
name : Environment variables
214
223
run : |
@@ -220,15 +229,16 @@ jobs:
220
229
-
221
230
# Login to Docker Hub
222
231
name : Login to Docker Hub
223
- uses : docker/login-action@v1
232
+ uses : docker/login-action@v3
224
233
with :
225
234
username : ${{ secrets.DOCKERHUB_USERNAME }}
226
235
password : ${{ secrets.DOCKERHUB_TOKEN }}
227
236
-
228
237
name : Retrieve test results
229
- uses : actions/download-artifact@v2
238
+ uses : actions/download-artifact@v4
230
239
with :
231
- name : test-results
240
+ pattern : test-results-${{ env.GIT_SHA7 }}-*
241
+ merge-multiple : true
232
242
-
233
243
# Generate persistent tags (edge, stable, release)
234
244
name : Docker image tags
@@ -265,5 +275,5 @@ jobs:
265
275
docker manifest push ${tag}
266
276
done
267
277
# Clean up intermediate arch-specific image tags (DockerHub only)
268
- .github/scripts/docker-tag-delete.sh ${{ env.BUILD_IMAGE_TAG }}-${{ env.GIT_SHA7 }}-amd64
269
- .github/scripts/docker-tag-delete.sh ${{ env.BUILD_IMAGE_TAG }}-${{ env.GIT_SHA7 }}-arm64
278
+ .github/scripts/docker-tag-delete.sh " ${{ env.BUILD_IMAGE_TAG }}-${{ env.GIT_SHA7 }}-amd64"
279
+ .github/scripts/docker-tag-delete.sh " ${{ env.BUILD_IMAGE_TAG }}-${{ env.GIT_SHA7 }}-arm64"
0 commit comments