7676
7777 build-docker :
7878
79- name : Build Docker image
79+ name : Build Docker image (Java ${{ matrix.java }})
8080 runs-on : ubuntu-latest
8181 needs : build
82+ strategy :
83+ matrix :
84+ java : [21, 25]
8285
8386 steps :
8487 - name : Checkout repository
@@ -96,17 +99,18 @@ jobs:
9699 with :
97100 context : .
98101 load : true
99- tags : ${{ env.IMAGE_NAME }}:ci-${{ github.sha }}
100- cache-from : type=gha,scope=openfire-${{ steps.cache-hash.outputs.hash }}
101- cache-to : type=gha,mode=max,scope=openfire-${{ steps.cache-hash.outputs.hash }}-${{ github.sha }}
102+ build-args : JAVA_VERSION=${{ matrix.java }}
103+ tags : ${{ env.IMAGE_NAME }}:ci-java${{ matrix.java }}-${{ github.sha }}
104+ cache-from : type=gha,scope=openfire-java${{ matrix.java }}-${{ steps.cache-hash.outputs.hash }}
105+ cache-to : type=gha,mode=max,scope=openfire-java${{ matrix.java }}-${{ steps.cache-hash.outputs.hash }}-${{ github.sha }}
102106
103107 - name : Save Docker image to tar archive
104- run : docker save ${{ env.IMAGE_NAME }}:ci-${{ github.sha }} | gzip > openfire-docker-image.tar.gz
108+ run : docker save ${{ env.IMAGE_NAME }}:ci-java${{ matrix.java }}- ${{ github.sha }} | gzip > openfire-docker-image.tar.gz
105109
106110 - name : Upload Docker image archive
107111 uses : actions/upload-artifact@v7
108112 with :
109- name : Openfire Docker Image
113+ name : Openfire Docker Image Java ${{ matrix.java }}
110114 path : openfire-docker-image.tar.gz
111115 retention-days : 1
112116
@@ -121,13 +125,13 @@ jobs:
121125 - name : Download Docker image archive
122126 uses : actions/download-artifact@v8
123127 with :
124- name : Openfire Docker Image
128+ name : Openfire Docker Image Java 21
125129 path : .
126130
127131 - name : Load Docker image
128132 run : |
129133 docker load < openfire-docker-image.tar.gz
130- docker tag ${{ env.IMAGE_NAME }}:ci-${{ github.sha }} openfire:latest
134+ docker tag ${{ env.IMAGE_NAME }}:ci-java21- ${{ github.sha }} openfire:latest
131135
132136 - name : Checkout Integration Tests
133137 uses : actions/checkout@v7
@@ -1244,10 +1248,13 @@ jobs:
12441248 IGNITE_REALTIME_MAVEN_PASSWORD : ${{ secrets.IGNITE_REALTIME_MAVEN_PASSWORD }}
12451249
12461250 publish-docker :
1247- name : Publish to GitHub's Docker registry
1251+ name : Publish to GitHub's Docker registry (Java ${{ matrix.java }})
12481252 runs-on : ubuntu-latest
12491253 needs : [build-docker, aioxmpp, connectivity, integration, xitf, check_branch, hsqldb-install, hsqldb-upgrade, sqlserver-install, sqlserver-upgrade, postgres-install, postgres-upgrade, cockroachdb-install, cockroachdb-upgrade, firebird-install, firebird-upgrade, mysql-install, mysql-upgrade, mariadb-install, mariadb-upgrade, oracle-install, oracle-upgrade]
12501254 if : ${{ github.repository == 'igniterealtime/Openfire' && github.event_name == 'push' && needs.check_branch.outputs.is_publishable_branch == 'true' }}
1255+ strategy :
1256+ matrix :
1257+ java : [21, 25]
12511258
12521259 permissions :
12531260 contents : read
@@ -1262,7 +1269,7 @@ jobs:
12621269 - name : Download Docker image archive
12631270 uses : actions/download-artifact@v8
12641271 with :
1265- name : Openfire Docker Image
1272+ name : Openfire Docker Image Java ${{ matrix.java }}
12661273 path : .
12671274
12681275 - name : Load Docker image
@@ -1275,19 +1282,28 @@ jobs:
12751282 username : ${{ github.actor }}
12761283 password : ${{ secrets.GITHUB_TOKEN }}
12771284
1278- - name : Extract metadata (tags, labels) for image registry
1285+ - name : Extract metadata (plain tags, default Java version only)
12791286 id : meta
1287+ if : ${{ matrix.java == 21 }}
1288+ uses : docker/metadata-action@v6
1289+ with :
1290+ images : ${{ env.REGISTRY }}/igniterealtime/${{ env.IMAGE_NAME }}
1291+
1292+ - name : Extract metadata (versioned tags)
1293+ id : meta-versioned
12801294 uses : docker/metadata-action@v6
12811295 with :
12821296 images : ${{ env.REGISTRY }}/igniterealtime/${{ env.IMAGE_NAME }}
1297+ flavor : suffix=-java${{ matrix.java }}
12831298
1284- - name : Retag and push final image
1299+ - name : Tag and push image
12851300 id : push
12861301 run : |
1287- FIRST_TAG=$(echo "${{ steps.meta.outputs.tags }}" | head -n1)
1288- docker tag ${{ env.IMAGE_NAME }}:ci-${{ github.sha }} $FIRST_TAG
1302+ ALL_TAGS=$(printf '%s\n' "${{ steps.meta.outputs.tags }}" "${{ steps.meta-versioned.outputs.tags }}" | grep -v '^$')
1303+ FIRST_TAG=$(echo "$ALL_TAGS" | head -n1)
1304+ docker tag ${{ env.IMAGE_NAME }}:ci-java${{ matrix.java }}-${{ github.sha }} $FIRST_TAG
12891305 DIGEST=$(docker push $FIRST_TAG | grep -oP 'digest: \K\S+')
1290- for tag in $(echo "${{ steps.meta.outputs.tags }} " | tail -n +2); do
1306+ for tag in $(echo "$ALL_TAGS " | tail -n +2); do
12911307 docker tag $FIRST_TAG $tag
12921308 docker push $tag
12931309 done
0 commit comments