@@ -19,6 +19,9 @@ inputs:
1919 registry_repository :
2020 description : ' Repository to push the image to'
2121 required : false
22+ release_tag :
23+ description : ' Release tag to build'
24+ required : false
2225
2326runs :
2427 using : " composite"
@@ -95,14 +98,14 @@ runs:
9598 load : true
9699 platforms : ${{ inputs.platform }}
97100 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 }}
100103
101104 - name : Save image
102105 shell : bash
103106 run : |
104107 docker save -o /tmp/image-${{ steps.platform.outputs.display_name }}.tar ${{ github.sha }}:${{ steps.platform.outputs.display_name }}
105-
108+
106109 - name : Upload image
107110 uses : actions/upload-artifact@v4
108111 with :
@@ -115,7 +118,7 @@ runs:
115118 if : ${{ contains(fromJSON('["amd64", "i386", "arm64"]'), steps.platform.outputs.display_name) }}
116119 run : |
117120 docker run -d --name sanity-test-${{ steps.platform.outputs.display_name }} ${{ github.sha }}:${{ steps.platform.outputs.display_name }}
118-
121+
119122 - name : Container Logs
120123 if : ${{ contains(fromJSON('["amd64", "i386", "arm64"]'), steps.platform.outputs.display_name) }}
121124 shell : bash
@@ -128,7 +131,7 @@ runs:
128131 run : |
129132 docker exec sanity-test-${{ steps.platform.outputs.display_name }} redis-cli ping
130133 docker exec sanity-test-${{ steps.platform.outputs.display_name }} redis-cli info server
131-
134+
132135 - name : Verify installed modules
133136 if : ${{ contains(fromJSON('["amd64", "arm64"]'), steps.platform.outputs.display_name) }}
134137 shell : bash
@@ -148,7 +151,7 @@ runs:
148151 echo "The following modules are missing: ${missing_modules[*]}"
149152 exit 1
150153 fi
151-
154+
152155 - name : Test RedisBloom
153156 if : ${{ contains(fromJSON('["amd64", "arm64"]'), steps.platform.outputs.display_name) }}
154157 shell : bash
@@ -158,7 +161,7 @@ runs:
158161 [ "$(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; }
159162 [ "$(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; }
160163 echo "RedisBloom test passed successfully"
161-
164+
162165 - name : Test RediSearch
163166 if : ${{ contains(fromJSON('["amd64", "arm64"]'), steps.platform.outputs.display_name) }}
164167 shell : bash
@@ -224,12 +227,44 @@ runs:
224227 path : test/report-entrypoint.xml
225228 reporter : java-junit
226229
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+
227242 - name : Push image
228243 uses : docker/build-push-action@v6
229244 if : ${{ inputs.publish_image == 'true' && contains(fromJSON('["amd64", "arm64"]'), steps.platform.outputs.display_name) }}
230245 with :
231246 context : ${{ inputs.distribution }}
232247 push : true
233- tags : ${{ inputs.registry_repository }}:${{ github.sha }}-${{ inputs.distribution }}
248+ tags : ${{ steps.format-registry-tag.outputs.tag }}
234249 cache-from : type=gha
235250 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