Преглед на файлове

add guard to ensure pom defined jfx version matches the jdk bundled/jmod one

Armin Schrenk преди 2 години
родител
ревизия
3641b34c2d
променени са 4 файла, в които са добавени 44 реда и са изтрити 0 реда
  1. 9 0
      .github/workflows/appimage.yml
  2. 17 0
      .github/workflows/debian.yml
  3. 9 0
      .github/workflows/mac-dmg.yml
  4. 9 0
      .github/workflows/win-exe.yml

+ 9 - 0
.github/workflows/appimage.yml

@@ -31,6 +31,15 @@ jobs:
           java-version: ${{ env.JAVA_VERSION }}
           java-package: 'jdk+fx'
           cache: 'maven'
+      - name: Ensure major jfx version in pom equals in jdk
+        shell: pwsh
+        run: |
+          $jfxPomVersion = (&mvn help:evaluate -Dexpression=javafx.version -q -DforceStdout) -split "\."
+          $jfxJdkVersion = (Get-Content -path "${env:JAVA_HOME}/lib/javafx.properties" | Where-Object {$_ -like 'javafx.version=*' }) -replace '.*=',''
+          if ($jfxPomVersion[0] -ne $jfxJdkVersion) {
+            Out-Error "Major part of JavaFX version in pom($($jfxPomVersion[0])) does not match the version in JDK(${jfxJdkVersion}) "
+            exit 1
+          }
       - name: Set version
         run : mvn versions:set -DnewVersion=${{ needs.get-version.outputs.semVerStr }}
       - name: Run maven

+ 17 - 0
.github/workflows/debian.yml

@@ -51,13 +51,30 @@ jobs:
       - name: Run maven
         run: mvn -B clean package -Pdependency-check,linux -DskipTests
       - name: Download OpenJFX jmods
+        id: download-jmods
         run: |
           curl -L ${{ env.OPENJFX_JMODS_AMD64 }} -o openjfx-amd64.zip
           mkdir -p jmods/amd64
           unzip -j openjfx-amd64.zip \*/javafx.base.jmod \*/javafx.controls.jmod \*/javafx.fxml.jmod \*/javafx.graphics.jmod -d jmods/amd64
+          unzip -j jmods/amd64/javafx.base.jmod lib/javafx.properties -d jmods/amd64
           curl -L ${{ env.OPENJFX_JMODS_AARCH64 }} -o openjfx-aarch64.zip
           mkdir -p jmods/aarch64
           unzip -j openjfx-aarch64.zip \*/javafx.base.jmod \*/javafx.controls.jmod \*/javafx.fxml.jmod \*/javafx.graphics.jmod -d jmods/aarch64
+          unzip -j jmods/aarch64/javafx.base.jmod lib/javafx.properties -d jmods/aarch64
+      - name: Ensure major jfx version in pom and in jmods is the same
+        shell: pwsh
+        run: |
+          $jfxPomVersion = (&mvn help:evaluate -Dexpression=javafx.version -q -DforceStdout) -split "\."
+          $jfxJmodVersionAmd64 = (Get-Content -Path "jmods/aarch64/javafx.properties" | Where-Object {$_ -like 'javafx.version=*' }) -replace '.*=',''
+          $jfxJmodVersionAarch64 = (Get-Content -Path "jmods/aarch64/javafx.properties" | Where-Object {$_ -like 'javafx.version=*' }) -replace '.*=',''
+          if ($jfxJmodVersionAmd64 -ne $jfxJmodVersionAarch64 ) {
+            Out-Error "JavaFX Jmods for aarch64 and amd64 are different major versions"
+            exit 1
+          }
+          if ($jfxPomVersion[0] -ne $jfxJmodVersionAmd64) {
+            Out-Error "Major part of JavaFX version in pom($($jfxPomVersion[0])) does not match the version of Jmods(${jfxJmodVersion}) "
+            exit 1
+          }
       - name: Create orig.tar.gz with common/ libs/ mods/ jmods/
         run: |
           mkdir pkgdir

+ 9 - 0
.github/workflows/mac-dmg.yml

@@ -44,6 +44,15 @@ jobs:
           java-package: 'jdk+fx'
           architecture: ${{ matrix.architecture }}
           cache: 'maven'
+      - name: Ensure major jfx version in pom equals in jdk
+        shell: pwsh
+        run: |
+          $jfxPomVersion = (&mvn help:evaluate -Dexpression=javafx.version -q -DforceStdout) -split "\."
+          $jfxJdkVersion = (Get-Content -path "${env:JAVA_HOME}/lib/javafx.properties" | Where-Object {$_ -like 'javafx.version=*' }) -replace '.*=',''
+          if ($jfxPomVersion[0] -ne $jfxJdkVersion) {
+            Out-Error "Major part of JavaFX version in pom($($jfxPomVersion[0])) does not match the version in JDK(${jfxJdkVersion}) "
+            exit 1
+          }
       - name: Set version
         run : mvn versions:set -DnewVersion=${{ needs.get-version.outputs.semVerStr }}
       - name: Run maven

+ 9 - 0
.github/workflows/win-exe.yml

@@ -39,6 +39,15 @@ jobs:
           java-version: ${{ env.JAVA_VERSION }}
           java-package: 'jdk+fx'
           cache: ${{ env.JAVA_CACHE }}
+      - name: Ensure major jfx version in pom equals in jdk
+        shell: pwsh
+        run: |
+          $jfxPomVersion = (&mvn help:evaluate -Dexpression=javafx.version -q -DforceStdout) -split "\."
+          $jfxJdkVersion = (Get-Content -path "${env:JAVA_HOME}/lib/javafx.properties" | Where-Object {$_ -like 'javafx.version=*' }) -replace '.*=',''
+          if ($jfxPomVersion[0] -ne $jfxJdkVersion) {
+            Out-Error "Major part of JavaFX version in pom($($jfxPomVersion[0])) does not match the version in JDK(${jfxJdkVersion}) "
+            exit 1
+          }
       - name: Set version
         run : mvn versions:set -DnewVersion=${{ needs.get-version.outputs.semVerStr }}
       - name: Run maven