Page 1 of 1

Autobuild LÖVE games on Travis CI

Posted: Sat Jan 21, 2017 6:48 pm
by premek
Hello,
here I wrote about how I configured my love builds to be done automatically by Travis CI. Maybe it helps somebody too.
It builds .love file, windows .exe and web version from source automatically.

https://medium.com/@premek/autobuild-lo ... .goui8inui

Re: Autobuild LÖVE games on Travis CI

Posted: Sat Jan 21, 2017 8:05 pm
by hypnoscope
Awesome, was planning on looking into this at some point as well. How do you get the .exe's back out again? S3?

Re: Autobuild LÖVE games on Travis CI

Posted: Sat Jan 21, 2017 8:53 pm
by premek
hypnoscope wrote:Awesome, was planning on looking into this at some point as well. How do you get the .exe's back out again? S3?
Travis creates .love file, downloads love binary, joins the love.exe with game.love together (which creates the game.exe) and uploads it back to github. You can check it here https://github.com/premek/enjoy

Re: Autobuild LÖVE games on Travis CI

Posted: Sat Jan 21, 2017 9:06 pm
by Positive07
hypnoscope wrote:Awesome, was planning on looking into this at some point as well. How do you get the .exe's back out again? S3?
Read the article, it deploys to Github Releases!

I have a very similar script somewhere (if I can't find it I'll write it again) for AppVeyor, but I had intentions to make one for TravisCI in order to deploy to Linux and Mac OSX, the script was something like this:

I first have an environment variable that determines the architecture, that means the script runs twice, once for 32bits and once for 64bits.
It basically downloads LÖVE for the specified architecture, unzipped it, and saved it in cache, downloaded and compiled LuaJIT 2.0.4 (for the specified architecture) and saved it in cache.

Then the script compiled binaries (for said architectures), after that static checks are made to all the .lua files using luacheck, and busted runs the tests (with coverage) on the spec, using the compiled LuaJIT executable.

After tests and checks succeed it creates a .love file with 7z, which gets combined with LÖVE's .exe. After that, rcedit changes the icon and metadata for said .exe.

Then the script creates a .zip file using 7z with: the .exe, all of the .dlls required by LÖVE, and any extra .dlls for the compiled binary modules, that .zip is then deployed to Github Releases

It was a really long script that did many things, yet it was lacking support for LuaRocks/LÖVE-rocks and even if ported to TravisCI I still need to create something that can create .apk's for Android and do something about iOS which I don't think would be an easy thing to deploy to CI tools

Re: Autobuild LÖVE games on Travis CI

Posted: Sat Jan 21, 2017 9:52 pm
by premek
Positive07 wrote:...
I didn't know rcedit. Thanks! Also I didn't yet explored the android builds of love...

Re: Autobuild LÖVE games on Travis CI

Posted: Sat Jan 21, 2017 11:41 pm
by hypnoscope
premek wrote:
hypnoscope wrote:Awesome, was planning on looking into this at some point as well. How do you get the .exe's back out again? S3?
Travis creates .love file, downloads love binary, joins the love.exe with game.love together (which creates the game.exe) and uploads it back to github. You can check it here https://github.com/premek/enjoy
Cool, sorry I missed that bit in the article! Thought you were just pushing the .js back up, clearly not. Nice one!

Re: Autobuild LÖVE games on Travis CI

Posted: Sun Apr 01, 2018 8:11 am
by KayleMaster
Any idea on how to write something similar but for gitlab's built in CI?

Re: Autobuild LÖVE games on Travis CI

Posted: Sun Apr 01, 2018 10:10 am
by premek
KayleMaster wrote: Sun Apr 01, 2018 8:11 am Any idea on how to write something similar but for gitlab's built in CI?
I don't know gitlab and never used it. But maybe it will be very similar? If they don't have Releases equivalent you can commit the binaries

Re: Autobuild LÖVE games on Travis CI

Posted: Sun Apr 01, 2018 10:12 am
by Nixola
Please do not commit the binaries. Having to download hundreds of megabytes just to get a ~10MB binary file is awful.

Re: Autobuild LÖVE games on Travis CI

Posted: Sun Apr 01, 2018 10:37 am
by KayleMaster
This is how a gitlab-ci.yml looks:

Code: Select all

image: node:6

build:
    stage: build
    script:
        - npm i gulp -g
        - npm i
        - gulp
        - gulp build-test
    cache:
        policy: push
        paths:
        - node_modules/
    artifacts:
        paths:
        - built/

test:
    stage: test
    script:
        - npm i gulp -g
        - npm i
        - gulp run-test
    cache:
        policy: pull
        paths:
        - node_modules/
    artifacts:
        paths:
        - built/
I only need CI, no CD. (build and test)
It's naive to expect you to learn gitlab CI's now, but I posted this just in case it's super similar.
EDIT:I found this, I think might be able to make something out of it
https://docs.gitlab.com/ee/ci/yaml/