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 }}
102+ build-args : JAVA_VERSION=${{ matrix.java }}
103+ tags : ${{ env.IMAGE_NAME }}:ci-java${{ matrix.java }}-${{ github.sha }}
100104 cache-from : type=gha,scope=openfire-${{ steps.cache-hash.outputs.hash }}
101105 cache-to : type=gha,mode=max,scope=openfire-${{ steps.cache-hash.outputs.hash }}
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
@@ -1258,10 +1262,13 @@ jobs:
12581262 IGNITE_REALTIME_MAVEN_PASSWORD : ${{ secrets.IGNITE_REALTIME_MAVEN_PASSWORD }}
12591263
12601264 publish-docker :
1261- name : Publish to GitHub's Docker registry
1265+ name : Publish to GitHub's Docker registry (Java ${{ matrix.java }})
12621266 runs-on : ubuntu-latest
12631267 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]
12641268 if : ${{ github.repository == 'igniterealtime/Openfire' && github.event_name == 'push' && needs.check_branch.outputs.is_publishable_branch == 'true' }}
1269+ strategy :
1270+ matrix :
1271+ java : [21, 25]
12651272
12661273 permissions :
12671274 contents : read
@@ -1276,7 +1283,7 @@ jobs:
12761283 - name : Download Docker image archive
12771284 uses : actions/download-artifact@v8
12781285 with :
1279- name : Openfire Docker Image
1286+ name : Openfire Docker Image Java ${{ matrix.java }}
12801287 path : .
12811288
12821289 - name : Load Docker image
@@ -1289,19 +1296,28 @@ jobs:
12891296 username : ${{ github.actor }}
12901297 password : ${{ secrets.GITHUB_TOKEN }}
12911298
1292- - name : Extract metadata (tags, labels) for image registry
1299+ - name : Extract metadata (plain tags, default Java version only)
12931300 id : meta
1301+ if : ${{ matrix.java == 21 }}
1302+ uses : docker/metadata-action@v6
1303+ with :
1304+ images : ${{ env.REGISTRY }}/igniterealtime/${{ env.IMAGE_NAME }}
1305+
1306+ - name : Extract metadata (versioned tags)
1307+ id : meta-versioned
12941308 uses : docker/metadata-action@v6
12951309 with :
12961310 images : ${{ env.REGISTRY }}/igniterealtime/${{ env.IMAGE_NAME }}
1311+ flavor : suffix=-java${{ matrix.java }}
12971312
1298- - name : Retag and push final image
1313+ - name : Tag and push image
12991314 id : push
13001315 run : |
1301- FIRST_TAG=$(echo "${{ steps.meta.outputs.tags }}" | head -n1)
1302- docker tag ${{ env.IMAGE_NAME }}:ci-${{ github.sha }} $FIRST_TAG
1316+ ALL_TAGS=$(printf '%s\n' "${{ steps.meta.outputs.tags }}" "${{ steps.meta-versioned.outputs.tags }}" | grep -v '^$')
1317+ FIRST_TAG=$(echo "$ALL_TAGS" | head -n1)
1318+ docker tag ${{ env.IMAGE_NAME }}:ci-java${{ matrix.java }}-${{ github.sha }} $FIRST_TAG
13031319 DIGEST=$(docker push $FIRST_TAG | grep -oP 'digest: \K\S+')
1304- for tag in $(echo "${{ steps.meta.outputs.tags }} " | tail -n +2); do
1320+ for tag in $(echo "$ALL_TAGS " | tail -n +2); do
13051321 docker tag $FIRST_TAG $tag
13061322 docker push $tag
13071323 done
0 commit comments