code-disaster / steamworks4j

A thin Java wrapper to access the Steamworks API
https://code-disaster.github.io/steamworks4j/
MIT License
468 stars 64 forks source link

Created Github Action for automating generation of prebuilt libraries. #135

Open Retzinsky opened 10 months ago

Retzinsky commented 10 months ago

Github Actions to automate creation of prebuilt libraries. The action triggers on any change to the source of java-wrapper or server. First job runs JNICodeGenerator to generate the C++ sources. Next, three jobs in parallel to build on the respective platforms. Last job creates a pull request to merge the new prebuilt libraries back into the project. Runs as-is, no changes to project setup required - it's essentially just the build instructions page in Action form using the existing build-natives scripts.

I added a couple of extra functions to my personal build (namely requestUserStats() and getUserStats()) and verified them as functional using this process in my own game, on Windows at least.

There's probably more fun stuff that could be added, perhaps caching of intermediate products etc but it only takes a couple of minutes to run as it is. Sure beats doing everything by hand!

code-disaster commented 6 months ago

I've added build actions myself a while back, but kept them in a separate and private repository, fetching steamworks4j as a submodule. I just wasn't sure about sharing binaries (premake) and Steamworks SDK files in a public repository.

Retzinsky commented 6 months ago

I've added build actions myself a while back, but kept them in a separate and private repository, fetching steamworks4j as a submodule. I just wasn't sure about sharing binaries (premake) and Steamworks SDK files in a public repository.

What's the issue with premake exactly? The premake used in this action is either installed with apt-get in the case of the linux build or pulled from premake's own repository in the case of windows/osx. Forgive me if I'm ignorant of something here, this isn't my area of expertise by any means.

As for the SDK I was definitely concerned about that too, but it turns out the guy who maintains Steamworks.NET already uploaded the whole thing publicly so I just pull that.

code-disaster commented 6 months ago

Oh, nothing wrong with premake. Just personal preferences. And I didn't know there's a GH actions recipe to get that one, too. :)