Autobuild LÖVE games on Travis CI

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
premek
Prole
Posts: 21
Joined: Mon Dec 28, 2015 12:44 am
Contact:

Autobuild LÖVE games on Travis CI

Post 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
hypnoscope
Prole
Posts: 5
Joined: Mon Dec 26, 2016 12:44 am
Contact:

Re: Autobuild LÖVE games on Travis CI

Post 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?
premek
Prole
Posts: 21
Joined: Mon Dec 28, 2015 12:44 am
Contact:

Re: Autobuild LÖVE games on Travis CI

Post 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
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: Autobuild LÖVE games on Travis CI

Post 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
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
premek
Prole
Posts: 21
Joined: Mon Dec 28, 2015 12:44 am
Contact:

Re: Autobuild LÖVE games on Travis CI

Post by premek »

Positive07 wrote:...
I didn't know rcedit. Thanks! Also I didn't yet explored the android builds of love...
hypnoscope
Prole
Posts: 5
Joined: Mon Dec 26, 2016 12:44 am
Contact:

Re: Autobuild LÖVE games on Travis CI

Post 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!
KayleMaster
Party member
Posts: 234
Joined: Mon Aug 29, 2016 8:51 am

Re: Autobuild LÖVE games on Travis CI

Post by KayleMaster »

Any idea on how to write something similar but for gitlab's built in CI?
premek
Prole
Posts: 21
Joined: Mon Dec 28, 2015 12:44 am
Contact:

Re: Autobuild LÖVE games on Travis CI

Post 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
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Autobuild LÖVE games on Travis CI

Post by Nixola »

Please do not commit the binaries. Having to download hundreds of megabytes just to get a ~10MB binary file is awful.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
KayleMaster
Party member
Posts: 234
Joined: Mon Aug 29, 2016 8:51 am

Re: Autobuild LÖVE games on Travis CI

Post 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/
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 50 guests