Jamepad icon indicating copy to clipboard operation
Jamepad copied to clipboard

Use Dockerfile and script for building in container instead of running the entire job in the container

Open SonicGDX opened this issue 1 year ago • 7 comments

As I mentioned in #23 and in https://github.com/libgdx/libgdx/issues/7477, the upload-artifact and download-artifact@v3 versions will be deprecated on November 30th. As v4 and v5 require node 20, when this happens it will break the existing linux job that uses a docker container for the whole job as the container uses glibc 2.17 which doesn't work with node 20.

This isn't fully ready yet, but I've changed the setup so that hopefully it continues to work with newer versions of actions like upload-artifact and setup-java. I've done this by moving the docker setup into its own action (which is local to the repo) that runs a script in the container that builds the natives and snapshots, but doesn't use any third party actions - meaning it should not be need node 20 to be used in the container.

Inspired by https://docs.github.com/en/actions/sharing-automations/creating-actions/creating-a-docker-container-action#introduction

The action does seem to run properly but of course I haven't tested it fully and there could be other issues with it.

SonicGDX avatar Nov 27 '24 20:11 SonicGDX

How it works is that when it enters the docker container, the working directory is mounted and mapped from the runner onto the container. So the runner does all the GitHub actions to clone/setup the repo and then enters the container to build the natives and snapshot. After the container exits the changes persist on the runner and the runner uploads the artifacts and deploys the snapshot.

SonicGDX avatar Nov 27 '24 20:11 SonicGDX

Sorry for so many unnecessary CI runs, I really should be pushing less often lol.

But I think I've mostly finished this now.

Since @theofficialgman developed the previous docker setup in #23 I think it would be very helpful if they reviewed this PR (if possible).

SonicGDX avatar Dec 03 '24 12:12 SonicGDX

Whoops, almost lost some of my work due to an accidental force push. Thankfully I still had it on my other machine. Force pushing is very dangerous, kids!

SonicGDX avatar Dec 15 '24 09:12 SonicGDX

Is this ready to merge since the pr to the main repo was merged?

MrStahlfelge avatar Dec 18 '24 16:12 MrStahlfelge

Is this ready to merge since the pr to the main repo was merged?

Not right now, but after I fix the jar names in the output being wrong it should be. I think using sed to substitute the name will be sufficient.

EDIT: rename, sorry, not sed.

SonicGDX avatar Dec 18 '24 16:12 SonicGDX

@MrStahlfelge

It should be ready to merge now. Though I did make a ton of commits, so you'd probably want to merge with Squash and Merge.

SonicGDX avatar Dec 18 '24 18:12 SonicGDX

@theofficialgman or @PokeMMO can you check this PR?

MrStahlfelge avatar Mar 11 '25 15:03 MrStahlfelge