Use Dockerfile and script for building in container instead of running the entire job in the container
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.
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.
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).
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!
Is this ready to merge since the pr to the main repo was merged?
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.
@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.
@theofficialgman or @PokeMMO can you check this PR?