Code Monkey home page Code Monkey logo

hello-gluon-ci's Introduction

HelloGluon CI

This sample shows how to automatically build a Gluon Application using Github Actions.

It uses a version of HelloGluon, a Hello World application with Java 11+, JavaFX 15+, Gluon Mobile and GraalVM. For more details about Gluon Applications in general, please have a look at the Gluon docs or the other samples.

This sample focuses on the continuous integration using Github Actions on these platforms:

  • Windows
  • MacOS
  • Linux
  • iOS
  • Android
  • Embedded - AArch64 Linux

All these platform specific workflows share these common steps:

  • Checkout your code
  • Setup the build environment, specific to the platform
  • Build the application
  • Upload the application

Next to the above steps, for iOS and Android, the workflow includes steps to properly sign and upload the binary to the Play Store and App Store.

Build setup

Building using Github Actions is not very different from building locally.

On top of a default Gluon application, the following releaseConfiguration was added to the maven-gluonfx-plugin configuration:

<configuration>
    <releaseConfiguration>
        <!-- for iOS -->
        <bundleVersion>${env.GITHUB_RUN_NUMBER}</bundleVersion>
        
        <!-- for Android -->
        <versionCode>${env.GITHUB_RUN_NUMBER}</versionCode>
        <providedKeyStorePath>${env.GLUON_ANDROID_KEYSTOREPATH}</providedKeyStorePath>
        <providedKeyStorePassword>${env.GLUON_ANDROID_KEYSTORE_PASSWORD}</providedKeyStorePassword>
        <providedKeyAlias>${env.GLUON_ANDROID_KEYALIAS}</providedKeyAlias>
        <providedKeyAliasPassword>${env.GLUON_ANDROID_KEYALIAS_PASSWORD}</providedKeyAliasPassword>
    </releaseConfiguration>
</configuration>

For iOS:

  • bundleVersion is set to the GITHUB_RUN_NUMBER, so each build will have unique CFBundleVersion. See this doc for more information.

For Android:

  • versionCode is set to the GITHUB_RUN_NUMBER, so each build will have a unique android:versionCode. See this doc for more information.
  • keystore configuration are taken from env variables, that will be set by the workflow action.

Gluon license

All workflows use this action this Gluon license action:

  - name: Gluon License
    uses: gluonhq/gluon-build-license@v1
    with:
      gluon-license: ${{ secrets.GLUON_LICENSE }}

Using a Gluon license is optional and depends on your situation. Have a look at the Gluon website for more information about licences or contact us.

Platforms

Github Action workflows are specified in .github/workflows and configured to be triggered on push. Depending on your own preference and requirements, this can of course be changed. Please refer to the GitHub Actions documentation for more information.

Windows

Windows

MacOS

MacOS

Linux

Linux

iOS

iOS

Android

Android

Embedded - AArch64 Linux

AArch64 Linux

hello-gluon-ci's People

Contributors

abhinayagarwal avatar erwin1 avatar gluon-bot avatar johanvos avatar jperedadnr avatar tiainen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

hello-gluon-ci's Issues

HelloGluon.exe fails when downloaded from (Releases Mac and Windows bundles" 0.0.1 Jan 20 2022) when some java distributions are in the PATH.

The program appears to start but fails silently, The Windows event viewer show the following details. I am seeing the same failure on both my desktop and laptop. Other observations that may be related are that the of the gluon samples at https://github.com/gluonhq/gluon-samples.git, The HelloWorld native executable works but the HelloFX native executable does not. Finally my own application exhibits similar behavior when I build it locally and when I build it with github action on the github runners.

Log Name: Application
Source: Application Error
Date: 1/30/2023 5:31:47 PM
Event ID: 1000
Task Category: (100)
Level: Error
Keywords: Classic
User: N/A
Computer: MEGAJAKE
Description:
Faulting application name: HelloGluon.exe, version: 18.0.0.0, time stamp: 0x61dd7ef9
Faulting module name: HelloGluon.exe, version: 18.0.0.0, time stamp: 0x61dd7ef9
Exception code: 0xc0000005
Fault offset: 0x0000000001ba8566
Faulting process id: 0x3e78
Faulting application start time: 0x01d934faa395b744
Faulting application path: C:\Users\david\Downloads\HelloGluon.exe
Faulting module path: C:\Users\david\Downloads\HelloGluon.exe
Report Id: efa59b26-5ab9-45ed-bb1b-8b206d388f05
Faulting package full name:
Faulting package-relative application ID:
Event Xml:



1000
0
2
100
0
0x80000000000000

62794


Application
MEGAJAKE



HelloGluon.exe
18.0.0.0
61dd7ef9
HelloGluon.exe
18.0.0.0
61dd7ef9
c0000005
0000000001ba8566
3e78
01d934faa395b744
C:\Users\david\Downloads\HelloGluon.exe
C:\Users\david\Downloads\HelloGluon.exe
efa59b26-5ab9-45ed-bb1b-8b206d388f05





Create Maven Archetype

Adjusting a demo to your own needs is always tedious and error prone. It would be nice to have a simple Maven Archetype that generates a fully customized project for the user of your example.

This could also be automated using a simple Maven build that re-creates the Archetype whenever the sample code changes.

Here is an example of how this would look like:
https://github.com/fuinorg/javafx-gluon-github-archetype/tree/main/archetype

The full project that generates the Archetype based on this repo is one level up:
https://github.com/fuinorg/javafx-gluon-github-archetype

In case you're interested, I could assist in moving the code from my repo to this one or a dedicated "Archetype" repo.

where can get the property value like env.GLUON_ANDROID_KEYSTOREPATH ?

pom.xml:
<version.code>${env.GITHUB_RUN_NUMBER}</version.code>
<provided.keystore.path>${env.GLUON_ANDROID_KEYSTOREPATH}</provided.keystore.path>
<provided.keystore.password>${env.GLUON_ANDROID_KEYSTORE_PASSWORD}</provided.keystore.password>
<provided.key.alias>${env.GLUON_ANDROID_KEYALIAS}</provided.key.alias>
<provided.key.alias.password>${env.GLUON_ANDROID_KEYALIAS_PASSWORD}</provided.key.alias.password>

where those properties values ?

ios push notification doesn't work

Push notifications are not working for my app: It is not displayed in the notification center, nor on the lock screen, nor in the banner. The certificate (push.p12) is correctly loaded and the relative keys are present on the .plist: UIBackgroundModes, NSAppTransportSecurity etc.
App notifications are enabled on my smartphone.
Can you help me?

AndroidAPK not working

Hi Gluon,
I tried to apply the CI-Logic to a project but noticed that the android-app wasn't starting.
After further investigation I've noticed that the Hello-gluon-ci android apk isn't working.

I've downloaded it from this page: https://github.com/gluonhq/hello-gluon-ci/actions/runs/548055765
I've installed it on a Zenfone6 and on a Samsung S10e, and on both devices the application didn't start.

This is the output:

02-24 13:20:25.278 26084 26084 V GraalActivity: surfaceCreated for com.gluonhq.helloandroid.MainActivity@226089b
02-24 13:20:25.278 26084 26084 V GraalActivity: loading substrate library
02-24 13:20:25.380 26084 26084 D AndroidRuntime: Shutting down VM
02-24 13:20:25.381 26084 26084 E AndroidRuntime: FATAL EXCEPTION: main
02-24 13:20:25.381 26084 26084 E AndroidRuntime: Process: com.gluonhq.samples.hellogluon, PID: 26084
02-24 13:20:25.381 26084 26084 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZdaPv" referenced by "/data/app/~~h8R9ow3hhK5u7p5jESJZRg==/com.gluonhq.samples.hellogluon-GZ2Saw06TQZD1v-CzYLKGw==/lib/arm64/libsubstrate.so"...
02-24 13:20:25.381 26084 26084 E AndroidRuntime: 	at java.lang.Runtime.loadLibrary0(Runtime.java:1087)
02-24 13:20:25.381 26084 26084 E AndroidRuntime: 	at java.lang.Runtime.loadLibrary0(Runtime.java:1008)
02-24 13:20:25.381 26084 26084 E AndroidRuntime: 	at java.lang.System.loadLibrary(System.java:1664)
02-24 13:20:25.381 26084 26084 E AndroidRuntime: 	at com.gluonhq.helloandroid.MainActivity.surfaceCreated(MainActivity.java:104)
02-24 13:20:25.381 26084 26084 E AndroidRuntime: 	at android.view.SurfaceView.updateSurface(SurfaceView.java:1173)
02-24 13:20:25.381 26084 26084 E AndroidRuntime: 	at android.view.SurfaceView.lambda$new$0$SurfaceView(SurfaceView.java:173)
02-24 13:20:25.381 26084 26084 E AndroidRuntime: 	at android.view.-$$Lambda$SurfaceView$w68OV7dB_zKVNsA-r0IrAUtyWas.onPreDraw(Unknown Source:2)
02-24 13:20:25.381 26084 26084 E AndroidRuntime: 	at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:1093)
02-24 13:20:25.381 26084 26084 E AndroidRuntime: 	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3115)
02-24 13:20:25.381 26084 26084 E AndroidRuntime: 	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1966)
02-24 13:20:25.381 26084 26084 E AndroidRuntime: 	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8226)
02-24 13:20:25.381 26084 26084 E AndroidRuntime: 	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1056)
02-24 13:20:25.381 26084 26084 E AndroidRuntime: 	at android.view.Choreographer.doCallbacks(Choreographer.java:878)
02-24 13:20:25.381 26084 26084 E AndroidRuntime: 	at android.view.Choreographer.doFrame(Choreographer.java:811)
02-24 13:20:25.381 26084 26084 E AndroidRuntime: 	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1041)
02-24 13:20:25.381 26084 26084 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:938)
02-24 13:20:25.381 26084 26084 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:99)
02-24 13:20:25.381 26084 26084 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:248)
02-24 13:20:25.381 26084 26084 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7787)
02-24 13:20:25.381 26084 26084 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
02-24 13:20:25.381 26084 26084 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
02-24 13:20:25.381 26084 26084 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:952)
02-24 13:20:25.383  1600 26106 I DropBoxManagerService: add tag=data_app_crash isTagEnabled=true flags=0x2
02-24 13:20:25.383  1600  9392 W ActivityTaskManager:   Force finishing activity com.gluonhq.samples.hellogluon/com.gluonhq.helloandroid.MainActivity

gluonhq/setup-graalvm causes warning because it is using node12 instead of node16

gluonhq/setup-graalvm doesn't provide an issue tracker, so I hope this is the right place.

At the moment, the Action causes the following warning because it is using node12 instead of node16:

The following actions uses node12 which is deprecated and will be forced to run on node16: gluonhq/setup-graalvm@6eecc74. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/

There is already an update PR available:

gluonhq/setup-graalvm#6

Provide example with actual GitHub release

First of all: thanks a lot for the excellent documentation Gluon provides! ๐Ÿ™

I'm currently migrating a JavaFX app from Java 8 / Oracle Java VM to Java 11 / GraalVM, particularly to provide native images. When it comes to GitHub Actions, I currently have two workflows:

  1. A main build that compiles and tests the project, including caching, code analysis etc. (Runs on every push.)
  2. A release build that creates an actual GitHub release and uploads the artifact. (Runs only on tags matching v*.)

Since both workflows run on Linux and are independent from each other, this is not a big deal. Now, with native images for Linux, macOS and Windows, it gets a bit more complicated. What I'm thinking of at the moment:

  1. A main build that does the same stuff as before, but also creates a native image for each OS for testing purposes.
  2. A release build that (again) does the same stuff as before, but also creates a native image for each OS. And once they have been created, they should be added to an automatically created GitHub release.

I'm not 100 % sure, but I think this requires job/workflow synchronization -- if one doesn't want to put everything in one big workflow.

My question is: do you already have an example for this or something similar? If not, I'm happy to submit a PR once I have figured this out.

Android build is broken due to changed Github Actions OS Image

@johanvos @jperedadnr

The Android build no longer works since ... Today.

It's indepdendent of the.project.
I think it due to the change of the default NDK from 21 to 25 on the 1. Auguest
actions/runner-images#5930

Here is a link to a failing build: https://github.com/FlorianKirmaier/hello-gluon-ci-test-browser/runs/7652185424?check_suite_focus=true

At the end i get the following exception:

[Wed Aug 03 12:49:01 UTC 2022][INFO] We will now compile your code for aarch64-linux-android. This may take some time.
java.io.IOException: You specified an android NDK, but it doesn't contain /usr/local/lib/android/sdk/ndk/25.0.8775105/toolchains/llvm/prebuilt/linux-x86_64/aarch64-linux-android/bin/objdump
	at com.gluonhq.substrate.target.AndroidTargetConfiguration.compile(AndroidTargetConfiguration.java:124)
	at com.gluonhq.substrate.SubstrateDispatcher.nativeCompile(SubstrateDispatcher.java:425)
	at com.gluonhq.NativeCompileMojo.execute(NativeCompileMojo.java:54)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
	at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2(MojoExecutor.java:370)
	at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute(MojoExecutor.java:351)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:215)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:171)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:163)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:294)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:960)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:293)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:196)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)

Adding the following Statement to the github actions build didn't fix it:

     - name: Install NDK 21
       run: |
         ANDROID_ROOT=/usr/local/lib/android
         ANDROID_SDK_ROOT=${ANDROID_ROOT}/sdk
         SDKMANAGER=${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager
         echo "y" | $SDKMANAGER "ndk;21.4.7075529"

Image build request failed with exit status 137

Hi,

I am currently trying to build an apk but the build exceeds memory limits. I thought I could manage the memory usage by changing the maximum heap size as suggested here but it still did not work. The build required approximately 10GB of memory and the the most memory we can obtain is 7GB. Any advice on how I can reduce the memory consumption?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.