Skip to content

Commit

Permalink
Updated Workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
salmonb committed May 29, 2024
1 parent 4e99aba commit f2c0e8a
Showing 1 changed file with 31 additions and 12 deletions.
43 changes: 31 additions & 12 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ jobs:
- os-config: 1 # Generates builds 1) 2) 3) 4) & 5)
os: ubuntu-latest
# Note: 1) must run on Ubuntu because the GitHub push action (to update the web-build branch) works only on Ubuntu
gwt-artifact-suffix: 'Web.war' # build 1)
j2cl-artifact-suffix: 'Web.war' # build 1)
#fatjar-artifact-suffix: 'Linux-x64-runnable.jar' # build 2)
#jvm-deb-artifact-suffix: 'Linux-x64-jvm-package.deb' # build 3)
#jvm-rpm-artifact-suffix: 'Linux-x64-jvm-package.rpm' # build 4)
#gluon-desktop-arch-token: 'x86_64-linux' # build 5)
#gluon-desktop-artifact-suffix: 'Linux-x64-native-runnable' # build 5)
MVN: '/tmp/maven/apache-maven-3.8.8/bin/mvn'

env:
app-name: ${{ matrix.app.name }}
Expand Down Expand Up @@ -90,14 +91,25 @@ jobs:

# Set up the JDK (WebFX requires JDK13+ due to javac bugs in prior versions - otherwise JDK11+ should be enough in theory)
- name: Set up JDK ${{ env.jdk-version }}
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ env.jdk-version }}

# Forcing Maven 3.8.8 because of a JavaFX issue with >= 3.9.7 and GluonFX Maven Plugin requires Maven 3.8.8
- if: runner.os != 'Windows'
name: Download and Install Maven 3.8.8
run: |
mkdir /tmp/download
mkdir /tmp/maven/
cd /tmp/download
curl -O https://dlcdn.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz
tar -xzf apache-maven-3.8.8-bin.tar.gz -C /tmp/maven/
${{ matrix.MVN }} -version
# Checkout this repository
- name: Checkout this repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: ${{ env.app-repo-dir }}

Expand Down Expand Up @@ -126,25 +138,25 @@ jobs:

# Building this repository with JDK 13+ (Java 11 target)
- name: Build this repository
run: mvn -B install
run: ${{ matrix.MVN }} -B install
working-directory: ${{ env.app-repo-dir }}

# Building GWT application (if required)
- if: matrix.gwt-artifact-suffix != null || matrix.app.gwt-push-branch != null && matrix.os-config == 1
name: Build GWT application
run: mvn -B -P gwt-compile package
run: ${{ matrix.MVN }} -B -P gwt-compile package
working-directory: ${{ env.app-parent-module-dir }}

# Building J2CL application (if required)
- if: matrix.j2cl-artifact-suffix != null || matrix.app.j2cl-push-branch != null && matrix.os-config == 1
name: Build J2CL application
run: mvn -B -P j2cl package
run: ${{ matrix.MVN }} -B -P j2cl package
working-directory: ${{ env.app-parent-module-dir }}

# Building OpenJFX fat jar and installers (if required)
- if: matrix.fatjar-artifact-suffix != null
name: Build OpenJFX fat jar and installers
run: mvn -B -P 'openjfx-fatjar,openjfx-desktop' package
run: ${{ matrix.MVN }} -B -P 'openjfx-fatjar,openjfx-desktop' package
working-directory: ${{ env.app-parent-module-dir }}


Expand Down Expand Up @@ -198,9 +210,16 @@ jobs:

# Staging 1)
- if: matrix.gwt-artifact-suffix != null
name: Copy Web archive to staging
name: Copy GWT archive to staging
run: cp ${{ env.app-gwt-module-dir }}/target/*.war staging/${{ env.app-name }}-${{ matrix.gwt-artifact-suffix }}

# Staging 1)
- if: matrix.j2cl-artifact-suffix != null
name: Copy J2CL archive to staging
run: |
zip -r ${{ env.app-j2cl-module-dir }}/target/Web.war ${{ env.app-j2cl-module-dir }}/target/${{ matrix.app.module-token }}-application-j2cl-${{ matrix.app.version }}
cp ${{ env.app-j2cl-module-dir }}/target/*.war staging/${{ env.app-name }}-${{ matrix.j2cl-artifact-suffix }}
# Staging 2) | 7) | 11)
- if: matrix.fatjar-artifact-suffix != null
name: Copy fat jar with OpenJFX to staging
Expand Down Expand Up @@ -244,7 +263,7 @@ jobs:
- if: matrix.msi-desktop-artifact-suffix != null
name: Create Windows Installer (msi)
run: |
mvn -B javafx:jlink
${{ matrix.MAVEN_BIN }}\mvn -B javafx:jlink
${{ env.JAVA_HOME }}\bin\jpackage --input .\target\ --name ${{ env.app-name }} --main-jar ${{ matrix.app.module-token }}-application-openjfx-${{ matrix.app.version }}.jar --main-class dev.webfx.platform.shared.services.boot.ApplicationBooter --type msi --runtime-image .\target\jlinkImage --app-version 0.0.0 --win-per-user-install --win-menu --win-menu-group WebFX
working-directory: ${{ env.app-openjfx-module-dir }}

Expand Down Expand Up @@ -300,7 +319,7 @@ jobs:
# Invoking the Gluon Client Maven plugin to build the native Desktop app (chaining build & package goals)
- if: matrix.gluon-desktop-artifact-suffix != null
name: Gluon Build for Desktop
run: mvn -B -P 'gluon-desktop' gluonfx:build gluonfx:package # May take a while
run: ${{ matrix.MVN }} -B -P 'gluon-desktop' gluonfx:build gluonfx:package # May take a while
env:
GRAALVM_HOME: ${{ env.JAVA_HOME }}
working-directory: ${{ env.app-gluon-module-dir }}
Expand Down Expand Up @@ -347,7 +366,7 @@ jobs:
name: Gluon Build for Android
run: |
export ANDROID_SDK=$ANDROID_HOME # Otherwise GluonFX 1.0.16 package task is failing
mvn -B -P 'gluon-android' clean gluonfx:build gluonfx:package # May take a while
${{ matrix.MVN }} -B -P 'gluon-android' clean gluonfx:build gluonfx:package # May take a while
env:
GRAALVM_HOME: ${{ env.JAVA_HOME }}
GLUON_ANDROID_KEYSTOREPATH: ${{ steps.android_keystore_file.outputs.filePath }}
Expand Down Expand Up @@ -404,7 +423,7 @@ jobs:
# Invoking the Gluon Client Maven plugin to build the native iOS app (chaining build & package goals)
- if: matrix.gluon-ios-arch-token != null && env.GLUON_IOS_CERTIFICATES_BASE64 != ''
name: Gluon Build for iOS
run: mvn -B -P 'gluon-ios' clean gluonfx:build gluonfx:package # May take a while
run: ${{ matrix.MVN }} -B -P 'gluon-ios' clean gluonfx:build gluonfx:package # May take a while
env:
GRAALVM_HOME: ${{ env.JAVA_HOME }}
working-directory: ${{ env.app-gluon-module-dir }}
Expand Down

0 comments on commit f2c0e8a

Please sign in to comment.