Native extensions + CI builds


Hello everyone!

I’ve just now added a first CI (continuous integration, a.k.a “autobuilder”) script to one of our extensions, extension-websocket. Having such a script makes it easier for us to verify that the extension builds properly for each platform after each commit we make to the repository. It also helps us make sure that the extension builds between Defold versions. The plan is to add such a script to all our supported extensions.

The script currently does these things:

  • Find the stable version of Defold
  • Download bob.jar
  • Resolve dependencies
  • Build the extension (i.e. the sample project)
  • Bundle the example project

This script is triggered on each push/pull request, but it’s also scheduled to build twice a month, to make sure the code doesn’t grow old between released Defold versions.

How to add the script to my native extension

The script is written to be very low maintenance, and could be used as-is.

Copy the bob.yml file into your repository, to .github/workflows/bob.yml, commit the file and push to your repository.

You can see the builds under the “Actions” tab in the github repo: example

Note, if you copy this script, it might be good if you change the cron job to some different time or date, as to not crowd the build server all at once :slight_smile:

How to write a Github CI script

You write a script (in Yaml) for Github Actions, which might look like this.

I hope this can give you a hint on how to start testing your own extensions and/or your games hosted on Github.

If you’re not using Github there are usually similar functionalities there.




This seems like a great place to plug my setup-defold Github Action which automatically downloads bob.jar and dmengine_headless in CI scripts :grinning: