Skip to content

Commit

Permalink
Publish workflow: add Update Readme file jdk section job
Browse files Browse the repository at this point in the history
  • Loading branch information
hbenali committed Oct 17, 2024
1 parent 242b455 commit 6eaa1db
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 2 deletions.
52 changes: 52 additions & 0 deletions .github/table-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
| Image | JDK | Python | GCC | Build tool | Tests |
|---------------------------------------|-----------|---------|------|----------------------------------------------|-----------------------------------------------------------|
| exoplatform/ci:base | n/a | 2.7 & 3 | 4.8 | n/a | [goss.yaml](base/tests/goss.yaml) |
| exoplatform/ci:base-alpine | n/a | 2.7 & 3 | 4.8 | n/a | [goss.yaml](base-alpine/tests/goss.yaml) |
| exoplatform/ci:base-ubuntu20 | n/a | 2.7 & 3 | 4.8 | n/a | [goss.yaml](base-ubuntu20/tests/goss.yaml) |
| exoplatform/ci:base-ubuntu22 | n/a | 2.7 & 3 | 4.8 | n/a | [goss.yaml](base-ubuntu22/tests/goss.yaml) |
| exoplatform/ci:base-ubuntu24 | n/a | 3 | 4.8 | n/a | [goss.yaml](base-ubuntu24/tests/goss.yaml) |
| exoplatform/ci:jdk6 | 1.6.0_45 | 2.7 & 3 | 4.8 | n/a | [goss.yaml](jdk/jdk6/tests/goss.yaml) |
| exoplatform/ci:jdk7 | 1.7.0_80 | 2.7 & 3 | 4.8 | n/a | [goss.yaml](jdk/jdk7/tests/goss.yaml) |
| exoplatform/ci:jdk8 | ${JDK8_VERSION} | 2.7 & 3 | 4.8 | n/a | [goss.yaml](jdk/jdk8/tests/goss.yaml) |
| exoplatform/ci:jdk11 | ${JDK11_VERSION} | 2.7 & 3 | 4.8 | n/a | [goss.yaml](jdk/jdk11/tests/goss.yaml) |
| exoplatform/ci:jdk17 | ${JDK17_VERSION} | 2.7 & 3 | 4.8 | n/a | [goss.yaml](jdk/jdk17/tests/goss.yaml) |
| exoplatform/ci:jdk17-alpine | ${JDK17_VERSION} | 2.7 & 3 | 4.8 | n/a | [goss.yaml](jdk/jdk17-alpine/tests/goss.yaml) |
| exoplatform/ci:jdk17-ubuntu20 | ${JDK17_VERSION} | 2.7 & 3 | 4.8 | n/a | [goss.yaml](jdk/jdk17-ubuntu20/tests/goss.yaml) |
| exoplatform/ci:jdk21-ubuntu20 | ${JDK21_VERSION} | 2.7 & 3 | 4.8 | n/a | [goss.yaml](jdk/${JDK21_VERSION}-ubuntu20/tests/goss.yaml) |
| exoplatform/ci:jdk21-ubuntu22 | ${JDK21_VERSION} | 2.7 & 3 | 11.4 | n/a | [goss.yaml](jdk/${JDK21_VERSION}-ubuntu22/tests/goss.yaml) |
| exoplatform/ci:jdk8-gradle2 | 1.8.0_202 | 2.7 & 3 | 4.8 | Gradle 2.14 | [goss.yaml](jdk/jdk8-gradle2/tests/goss.yaml) |
| exoplatform/ci:jdk8-gradle2-android | 1.8.0_202 | 2.7 & 3 | 4.8 | Gradle 2.14 / Android 23/24 | [goss.yaml](gradle/jdk8-gradle2-android/tests/goss.yaml) |
| exoplatform/ci:jdk8-gradle4 | ${JDK8_VERSION} | 2.7 & 3 | 4.8 | Gradle 4.1 | [goss.yaml](jdk/jdk8-gradle4/tests/goss.yaml) |
| exoplatform/ci:jdk8-gradle4-android | ${JDK8_VERSION} | 2.7 & 3 | 4.8 | Gradle 4.1 / Android 23/24/25/26/27 | [goss.yaml](gradle/jdk8-gradle4-android/tests/goss.yaml) |
| exoplatform/ci:jdk8-gradle6 | ${JDK8_VERSION} | 2.7 & 3 | 4.8 | Gradle 6.1 | [goss.yaml](jdk/jdk8-gradle6/tests/goss.yaml) |
| exoplatform/ci:jdk8-gradle6-android | ${JDK8_VERSION} | 2.7 & 3 | 4.8 | Gradle 6.1 / Android 23/24/25/26/27 | [goss.yaml](gradle/jdk8-gradle6-android/tests/goss.yaml) |
| exoplatform/ci:jdk17-gradle8 | ${JDK17_VERSION} | 2.7 & 3 | 11.4 | Gradle 8.7 | [goss.yaml](jdk/jdk17-gradle8/tests/goss.yaml) |
| exoplatform/ci:jdk17-gradle8-android | ${JDK17_VERSION} | 2.7 & 3 | 11.4 | Gradle 8.7 / Android 23/24/25/26/27/28/29/33 | [goss.yaml](gradle/jdk17-gradle8-android/tests/goss.yaml) |
| exoplatform/ci:jdk6-maven30 | 1.6.0_45 | 2.7 & 3 | 4.8 | Maven 3.0.5 | [goss.yaml](maven/jdk6-maven30/tests/goss.yaml) |
| exoplatform/ci:jdk6-maven32 | 1.6.0_45 | 2.7 & 3 | 4.8 | Maven 3.2.5 | [goss.yaml](maven/jdk6-maven32/tests/goss.yaml) |
| exoplatform/ci:jdk7-maven30 | 1.7.0_80 | 2.7 & 3 | 4.8 | Maven 3.0.5 | [goss.yaml](maven/jdk7-maven30/tests/goss.yaml) |
| exoplatform/ci:jdk7-maven32 | 1.7.0_80 | 2.7 & 3 | 4.8 | Maven 3.2.5 | [goss.yaml](maven/jdk7-maven32/tests/goss.yaml) |
| exoplatform/ci:jdk8-maven30 | ${JDK8_VERSION} | 2.7 & 3 | 4.8 | Maven 3.0.5 | [goss.yaml](maven/jdk8-maven30/tests/goss.yaml) |
| exoplatform/ci:jdk8-maven32 | ${JDK8_VERSION} | 2.7 & 3 | 4.8 | Maven 3.2.5 | [goss.yaml](maven/jdk8-maven32/tests/goss.yaml) |
| exoplatform/ci:jdk8-maven33 | ${JDK8_VERSION} | 2.7 & 3 | 4.8 | Maven 3.3.9 | [goss.yaml](maven/jdk8-maven33/tests/goss.yaml) |
| exoplatform/ci:jdk8-maven35 | ${JDK8_VERSION} | 2.7 & 3 | 4.8 | Maven 3.5.4 | [goss.yaml](maven/jdk8-maven35/tests/goss.yaml) |
| exoplatform/ci:jdk11-maven32 | ${JDK11_VERSION} | 2.7 & 3 | 4.8 | Maven 3.2.5 | [goss.yaml](maven/jdk11-maven32/tests/goss.yaml) |
| exoplatform/ci:jdk11-maven33 | ${JDK11_VERSION} | 2.7 & 3 | 4.8 | Maven 3.3.9 | [goss.yaml](maven/jdk11-maven33/tests/goss.yaml) |
| exoplatform/ci:jdk11-maven35 | ${JDK11_VERSION} | 2.7 & 3 | 4.8 | Maven 3.5.4 | [goss.yaml](maven/jdk11-maven35/tests/goss.yaml) |
| exoplatform/ci:jdk11-maven36 | ${JDK11_VERSION} | 2.7 & 3 | 4.8 | Maven 3.6.3 | [goss.yaml](maven/jdk11-maven36/tests/goss.yaml) |
| exoplatform/ci:jdk11-maven38 | ${JDK11_VERSION} | 2.7 & 3 | 4.8 | Maven 3.8.8 | [goss.yaml](maven/jdk11-maven38/tests/goss.yaml) |
| exoplatform/ci:jdk11-mavend08 | ${JDK11_VERSION} | 2.7 & 3 | 4.8 | Mavend 0.8.2 | [goss.yaml](mavend/jdk11-mavend08/tests/goss.yaml) |
| exoplatform/ci:jdk17-maven36 | ${JDK17_VERSION} | 2.7 & 3 | 4.8 | Maven 3.6.3 | [goss.yaml](maven/jdk17-maven36/tests/goss.yaml) |
| exoplatform/ci:jdk17-maven38 | ${JDK17_VERSION} | 2.7 & 3 | 4.8 | Maven 3.8.8 | [goss.yaml](maven/jdk17-maven38/tests/goss.yaml) |
| exoplatform/ci:jdk17-mavend08 | ${JDK17_VERSION} | 2.7 & 3 | 4.8 | Mavend 0.8.2 | [goss.yaml](mavend/jdk17-mavend08/tests/goss.yaml) |
| exoplatform/ci:jdk17-mavend09 | ${JDK17_VERSION} | 2.7 & 3 | 4.8 | Mavend 0.9.0 | [goss.yaml](mavend/jdk17-mavend09/tests/goss.yaml) |
| exoplatform/ci:jdk17-maven39 | ${JDK17_VERSION} | 2.7 & 3 | 4.8 | Maven 3.9.9 | [goss.yaml](maven/jdk17-maven39/tests/goss.yaml) |
| exoplatform/ci:jdk17-maven39-alpine | ${JDK17_VERSION} | 2.7 & 3 | 4.8 | Maven 3.9.9 | [goss.yaml](maven/jdk17-maven39-alpine/tests/goss.yaml) |
| exoplatform/ci:jdk17-maven39-ubuntu20 | ${JDK17_VERSION} | 2.7 & 3 | 4.8 | Maven 3.9.9 | [goss.yaml](maven/jdk17-maven39-ubuntu20/tests/goss.yaml) |
| exoplatform/ci:jdk17-maven39-ubuntu22 | ${JDK17_VERSION} | 2.7 & 3 | 11.4 | Maven 3.9.9 | [goss.yaml](maven/jdk17-maven39-ubuntu22/tests/goss.yaml) |
| exoplatform/ci:jdk17-maven39-ubuntu24 | ${JDK17_VERSION} | 3 | 11.4 | Maven 3.9.9 | [goss.yaml](maven/jdk17-maven39-ubuntu24/tests/goss.yaml) |
| exoplatform/ci:jdk17-maven40-ubuntu22 | ${JDK17_VERSION} | 2.7 & 3 | 11.4 | Maven 4.0.0 (beta) | [goss.yaml](maven/jdk17-maven40-ubuntu22/tests/goss.yaml) |
| exoplatform/ci:jdk21-maven39-ubuntu20 | ${JDK21_VERSION} | 2.7 & 3 | 4.8 | Maven 3.9.9 | [goss.yaml](maven/jdk21-maven39-ubuntu20/tests/goss.yaml) |
| exoplatform/ci:jdk21-maven39-ubuntu22 | ${JDK21_VERSION} | 2.7 & 3 | 11.4 | Maven 3.9.9 | [goss.yaml](maven/jdk21-maven39-ubuntu22/tests/goss.yaml) |
| exoplatform/ci:jdk21-maven39-ubuntu24 | ${JDK21_VERSION} | 3 | 11.4 | Maven 3.9.9 | [goss.yaml](maven/jdk21-maven39-ubuntu24/tests/goss.yaml) |
| exoplatform/ci:jdk21-maven40-ubuntu22 | ${JDK21_VERSION} | 2.7 & 3 | 11.4 | Maven 4.0.0 (beta) | [goss.yaml](maven/jdk21-maven40-ubuntu22/tests/goss.yaml) |
42 changes: 41 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,4 +242,44 @@ jobs:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_PRIVATE_KEY_ID: ${{ secrets.DOCKER_PRIVATE_KEY_ID }}
DOCKER_PRIVATE_KEY: ${{ secrets.DOCKER_PRIVATE_KEY }}
DOCKER_PRIVATE_KEY_PASSPHRASE: ${{ secrets.DOCKER_PRIVATE_KEY_PASSPHRASE }}
DOCKER_PRIVATE_KEY_PASSPHRASE: ${{ secrets.DOCKER_PRIVATE_KEY_PASSPHRASE }}

update-zulu-jdks-readme:
name: "Update Readme file jdk section"
needs: build-jdk-images
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check latest jdk versions
run: |
if ! grep -q '<!-- GHASTART -->' README.md; then
echo "Error: Cannot find <!-- GHASTART --> md comment in Readme.md file! Abort"
exit 1
fi
if ! grep -q '<!-- GHAEND -->' README.md; then
echo "Error: Cannot find <!-- GHAEND --> md comment in Readme.md file! Abort"
exit 1
fi
echo "Fetching latest versions of JDK (${jdk_list}):"
for major_jdk_version in ${jdk_list//,/ }; do
latestversion=$(curl -fsSL -X GET "https://api.azul.com/metadata/v1/zulu/packages/?java_version=${major_jdk_version}&os=ubuntu&arch=amd&java_package_type=jdk&javafx_bundled=true&release_status=ga&availability_types=CA&certifications=tck&page=1&page_size=1" -H "accept: application/json" | jq -r '.[].java_version | join(",")')
if [ -z "${latestversion}" ]; then
echo "Error: Cannot find latest version for JDK ${major_jdk_version}! Abort!"
exit 1
fi
export JDK${major_jdk_version}_VERSION=$(echo ${latestversion} | sed 's/,/./g')
done
perl -pe 's/\$\{([^}]+)\}/$ENV{$1} || ""/ge' .github/table-template.md | column -t -s '|' -o '|' > /tmp/mdtable
sed '/<!-- GHASTART -->/q' README.md > /tmp/newreadme
cat /tmp/mdtable >> /tmp/newreadme
sed -n '/<!-- GHAEND -->/,$p' README.md >> /tmp/newreadme
cp -f /tmp/newreadme README.md
git status
git config --global user.email "exo-swf@exoplatform.com"
git config --global user.name "eXo Software Factory"
git add README.md
git diff-index --quiet HEAD || git commit -m "Automated JDK versions README update"
git push origin HEAD
env:
jdk_list: 8,11,17,21
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ The aim of this repository is to give the configuration to **build all eXo Platf

It contains **Dockerfiles, Tests and configuration** for the following CI Images:

<!-- The comment below is used to dynamically update JDK versions by build.yml workflow. DO NOT REMOVE THIS COMMENT AND THE END ONE -->
<!-- The below content is managed by the build github action. For table modification: edit before .github/table-template.md file -->
<!-- GHASTART -->
| Image | JDK | Python | GCC | Build tool | Tests
|-------------------------------------|-------------|----------|-----|----------------|------------
| exoplatform/ci:base | n/a | 2.7 & 3 | 4.8 | n/a | [goss.yaml](base/tests/goss.yaml)
Expand Down Expand Up @@ -70,7 +73,7 @@ It contains **Dockerfiles, Tests and configuration** for the following CI Images
| exoplatform/ci:jdk21-maven39-ubuntu22 | 21 | 2.7 & 3 | 11.4 | Maven 3.9.9 | [goss.yaml](maven/jdk21-maven39-ubuntu22/tests/goss.yaml)
| exoplatform/ci:jdk21-maven39-ubuntu24 | 21 | 3 | 11.4 | Maven 3.9.9 | [goss.yaml](maven/jdk21-maven39-ubuntu24/tests/goss.yaml)
| exoplatform/ci:jdk21-maven40-ubuntu22 | 21 | 2.7 & 3 | 11.4 | Maven 4.0.0 (beta) | [goss.yaml](maven/jdk21-maven40-ubuntu22/tests/goss.yaml)

<!-- GHAEND -->

## Overview

Expand Down

0 comments on commit 6eaa1db

Please sign in to comment.