@@ -19,6 +19,9 @@ inputs:
19
19
registry_repository :
20
20
description : ' Repository to push the image to'
21
21
required : false
22
+ release_tag :
23
+ description : ' Release tag to build'
24
+ required : false
22
25
23
26
runs :
24
27
using : " composite"
@@ -95,14 +98,14 @@ runs:
95
98
load : true
96
99
platforms : ${{ inputs.platform }}
97
100
tags : ${{ github.sha }}:${{ steps.platform.outputs.display_name }}
98
- cache-from : type=gha
99
- cache-to : type=gha,mode=max
101
+ cache-from : type=gha,scope=${{ inputs.distribution }}-${{ steps.platform.outputs.display_name }}
102
+ cache-to : type=gha,mode=max,scope=${{ inputs.distribution }}-${{ steps.platform.outputs.display_name }}
100
103
101
104
- name : Save image
102
105
shell : bash
103
106
run : |
104
107
docker save -o /tmp/image-${{ steps.platform.outputs.display_name }}.tar ${{ github.sha }}:${{ steps.platform.outputs.display_name }}
105
-
108
+
106
109
- name : Upload image
107
110
uses : actions/upload-artifact@v4
108
111
with :
@@ -115,7 +118,7 @@ runs:
115
118
if : ${{ contains(fromJSON('["amd64", "i386", "arm64"]'), steps.platform.outputs.display_name) }}
116
119
run : |
117
120
docker run -d --name sanity-test-${{ steps.platform.outputs.display_name }} ${{ github.sha }}:${{ steps.platform.outputs.display_name }}
118
-
121
+
119
122
- name : Container Logs
120
123
if : ${{ contains(fromJSON('["amd64", "i386", "arm64"]'), steps.platform.outputs.display_name) }}
121
124
shell : bash
@@ -128,7 +131,7 @@ runs:
128
131
run : |
129
132
docker exec sanity-test-${{ steps.platform.outputs.display_name }} redis-cli ping
130
133
docker exec sanity-test-${{ steps.platform.outputs.display_name }} redis-cli info server
131
-
134
+
132
135
- name : Verify installed modules
133
136
if : ${{ contains(fromJSON('["amd64", "arm64"]'), steps.platform.outputs.display_name) }}
134
137
shell : bash
@@ -148,7 +151,7 @@ runs:
148
151
echo "The following modules are missing: ${missing_modules[*]}"
149
152
exit 1
150
153
fi
151
-
154
+
152
155
- name : Test RedisBloom
153
156
if : ${{ contains(fromJSON('["amd64", "arm64"]'), steps.platform.outputs.display_name) }}
154
157
shell : bash
@@ -158,7 +161,7 @@ runs:
158
161
[ "$(docker exec sanity-test-${{ steps.platform.outputs.display_name }} redis-cli BF.EXISTS popular_keys "redis:hash")" = "1" ] || { echo "RedisBloom test failed: 'redis:hash' not found"; exit 1; }
159
162
[ "$(docker exec sanity-test-${{ steps.platform.outputs.display_name }} redis-cli BF.EXISTS popular_keys "redis:list")" = "0" ] || { echo "RedisBloom test failed: 'redis:list' found unexpectedly"; exit 1; }
160
163
echo "RedisBloom test passed successfully"
161
-
164
+
162
165
- name : Test RediSearch
163
166
if : ${{ contains(fromJSON('["amd64", "arm64"]'), steps.platform.outputs.display_name) }}
164
167
shell : bash
@@ -224,12 +227,44 @@ runs:
224
227
path : test/report-entrypoint.xml
225
228
reporter : java-junit
226
229
230
+ - name : Format registry tag
231
+ id : format-registry-tag
232
+ shell : bash
233
+ run : |
234
+ printf "tag=%s:%s%s-%s-%s" \
235
+ "${{ inputs.registry_repository }}" \
236
+ "${{ inputs.release_tag != '' && format('{0}-', inputs.release_tag || '') }}" \
237
+ "${{ github.sha }}" \
238
+ "${{ inputs.distribution }}" \
239
+ "${{ steps.platform.outputs.display_name }}" \
240
+ | tr '[:upper:]' '[:lower:]' >> "$GITHUB_OUTPUT"
241
+
227
242
- name : Push image
228
243
uses : docker/build-push-action@v6
229
244
if : ${{ inputs.publish_image == 'true' && contains(fromJSON('["amd64", "arm64"]'), steps.platform.outputs.display_name) }}
230
245
with :
231
246
context : ${{ inputs.distribution }}
232
247
push : true
233
- tags : ${{ inputs.registry_repository }}:${{ github.sha }}-${{ inputs.distribution }}
248
+ tags : ${{ steps.format-registry-tag.outputs.tag }}
234
249
cache-from : type=gha
235
250
cache-to : type=gha,mode=max
251
+
252
+ - name : Save image URL to artifact
253
+ shell : bash
254
+ run : |
255
+ if [[ "${{ inputs.publish_image }}" == "true" && "${{ contains(fromJSON('["amd64", "arm64"]'), steps.platform.outputs.display_name) }}" == "true" ]]; then
256
+ # Create a file with the image URL for this specific build
257
+ mkdir -p /tmp/image-urls
258
+ echo "${{ steps.format-registry-tag.outputs.tag }}" > "/tmp/image-urls/${{ inputs.distribution }}-${{ steps.platform.outputs.display_name }}.txt"
259
+ echo "Image URL saved: ${{ steps.format-registry-tag.outputs.tag }}"
260
+ else
261
+ echo "Image not published for this platform/distribution combination"
262
+ fi
263
+
264
+ - name : Upload image URL artifact
265
+ uses : actions/upload-artifact@v4
266
+ if : ${{ inputs.publish_image == 'true' && contains(fromJSON('["amd64", "arm64"]'), steps.platform.outputs.display_name) }}
267
+ with :
268
+ name : image-url-${{ inputs.distribution }}-${{ steps.platform.outputs.display_name }}
269
+ path : /tmp/image-urls/${{ inputs.distribution }}-${{ steps.platform.outputs.display_name }}.txt
270
+ retention-days : 1
0 commit comments