User Tools

Site Tools


gamedev:gameci
,

Start Page » Game Development with the Drag[en]gine » Game CI (Continuous Integration)

Game CI (Continuous Integration)

Game CI (Continuous Integration)

The IGDE can be used to build distribution files (*.delga) from the console. This especially allows to easily create distribution files using existing free continuous integration solutions without needing costly services nor being complicated at all.

In the IGDE each editor module can provide command line interactions. To learn about them open a console, change directory to your project directory then enter:

deigde <project-file> --help

whereas “<project-file>” is the relative or absolute path to the project file (*.degp). This will list all command line interactions provided by all editors supporting them. Commands are formed like this: “<editor>.<action>”, whereas “<action>” can be any string including more dots.

Most important are actions by “project” which is the Project Editor/Runner you usually use to build distribution files. To build a distribution file run this command in the console:

deigde <project-file> --project.profile.distribute <profile-name>

This will build the distribution file for the profile named “<profile-name>”. The distribution file will be written to the file stored in the profile.

If you use file name versioning it is recommended to use an unversioned file name here, for example “MyGame.delga” and renaming the distribution file using your CI system of choice afterwards, for example to “MyGame-2.5.delga”. This makes it easier to write CI scripts since the filename is well known.

CI/Build Server

While you can use the regular IGDE to run commands from the console on your developer machine on a CI/Build servers without UI (like docker images) this is not going to work. For CI/Build servers a special IGDE build exists which runs on UI-less systems. Download and install these two files:

This downloads the latest nightly build. You can also use regular release versions from Drag[en]gine Releases. The files are named install-dragengine-ci-{version}.sh and install-deigde-ci-{version}.sh.

Except from being UI-less it behaves the same for console use as the regular IGDE.

The sections below show some examples on how to use this in CI-Systems.

Docker

Docker Logo

A docker image is ready made to be used: Docker Image DEIGDE-CI. The ready made docker image contains the most recent stable release.

To run the docker image use a command line like this:

docker run -it --rm --volume=/home/user/deprojects/MyGame:/project lordofdragons/deigde-ci /project/MyGame.degp --project.profile.distribute Release

The *.delga file is then located in the path /home/user/deprojects/MyGame/{path-delga} whereas {path-delga} is the path set in the profile Release.

Custom Docker Image

If you want to integrate the IGDE-CI directly into your docker build image you can do this with the following run commands:

ENV DE_RELEASE_VERSION=1.13
ENV BASE_URL_DE_RELEASE=https://github.com/LordOfDragons/dragengine/releases/download/v$DE_RELEASE_VERSION
 
RUN curl -sL -o install-dragengine-ci.sh $BASE_URL_DE_RELEASE/install-dragengine-ci-$DE_RELEASE_VERSION-linux64.sh \
 && curl -sL -o install-deigde-ci.sh $BASE_URL_DE_RELEASE/install-deigde-ci-$DE_RELEASE_VERSION-linux64.sh \
 && chmod 755 install-dragengine-ci.sh install-deigde-ci.sh \
 && ./install-dragengine-ci.sh --yes \
 && ./install-deigde-ci.sh --yes \
 && rm install-dragengine-ci.sh install-deigde-ci.sh

Adjust DE_RELEASE_VERSION to the Drag[en]gine release version to use. This script requires “curl”, “tar” and “bzip2” to be present otherwise it fails.

GitHub Actions

Github Actions Logo

For GitHub Actions a ready made action is provided: Build DELGA distribution docker action. This action allows to run the distribute command. To use the action checkout the game project from your repository then include this code in your build script:

      - name: Distribute
        id: distribute
        uses: LordOfDragons/build-delga@v1
        with:
          projectFile: 'MyGame.degp'
          profile: 'Release'

A full example could look like this:

name: Distribute

on:
  workflow_dispatch:

jobs:
  distribute:
    runs-on: ubuntu-latest
    
    steps:
      - uses: actions/checkout@v3
        with:
          lfs: true
      
      - name: Distribute
        id: distribute
        uses: LordOfDragons/build-delga@v1
        with:
          projectFile: 'MyGame.degp'
          profile: 'Release'

The upcoming build scripts can then use the distribution file with the path distribute/MyGame.delga given this is the path stored in the profile Release.

Custom Actions Script

If you do not want to use the provided action, for example to use commands beyond building the distribution file, you can either use the docker image from the previous section or you can install the IGDE-CI into the running VM instance like this:

      - name: Install IGDE-CI
        run: |
          DE_RELEASE_VERSION=1.13
          BASE_URL_DE_RELEASE=https://github.com/LordOfDragons/dragengine/releases/download/v$DE_RELEASE_VERSION
          curl -sL -o install-dragengine-ci.sh $BASE_URL_DE_RELEASE/install-dragengine-ci-$DE_RELEASE_VERSION-linux64.sh
          curl -sL -o install-deigde-ci.sh $BASE_URL_DE_RELEASE/install-deigde-ci-$DE_RELEASE_VERSION-linux64.sh
          chmod 755 install-dragengine-ci.sh install-deigde-ci.sh
          sudo ./install-dragengine-ci.sh --yes
          sudo ./install-deigde-ci.sh --yes
          rm install-dragengine-ci.sh install-deigde-ci.sh

Then you can use deigde command directly.

Jenkins

For Jenkins it is recommended to use the docker image mentioned above. You can also install the IGDE-CI directly into your build system as outline in the previous section. It is though easier to use the ready made docker image.

You could leave a comment if you were logged in.
gamedev/gameci.txt · Last modified: 2022/07/01 16:55 by dragonlord