Ludeon Forums

Ludeon Forums

  • December 05, 2020, 06:36:36 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [TOOL] GitHub Actions - Workflow to compile mods online  (Read 1052 times)

krafs

  • Drifter
  • **
  • Posts: 42
  • Maker
    • View Profile
[TOOL] GitHub Actions - Workflow to compile mods online
« on: December 01, 2019, 11:44:45 AM »

I've made a workflow on GitHub that is triggered whenever my mod repository receives a pushed commit. It then proceeds to build the mod online, on three virtual environments: Windows, Ubuntu and MacOS, and notifies me if a build has failed.

Why?
This kind of functionality falls into the category of Continuous Integration (and other closely related concepts). The main benefit is for teams of developers working on the same code being confident the branch they're working on isn't broken - by continuously integrating their changes to the main code branch. You can read more about CI/CD here.

However, it can also benefit single developers by ensuring that building a project not only works under the specific conditions of one's local machine, but on any machine, regardless of operating system. It also opens up for a variety of other things you might want to do with your mod, like zip it and upload as a release, or send emails about successful builds. You can even make your own actions to do pretty much anything you want. It can also be fun. Because automating things is fun :)

Feel free to have a look at the repository here.

GitHub Actions
GitHub Actions is a GitHub feature that allows building workflows that can be triggered by various events. Whenever a workflow is triggered, GitHub starts a virtual machine within which you can run commands, download repositories, build, test, and do all sorts of things. Read more about GitHub Actions here.
« Last Edit: December 02, 2019, 04:14:16 PM by krafs »
Logged

LWM

  • Planetologist
  • ****
  • Posts: 1061
  • Little White Mouse
    • View Profile
Re: [TOOL] GitHub Actions - Workflow to compile mods online
« Reply #1 on: December 02, 2019, 03:42:50 PM »

If you make a workflow that puts together a Release .zip and a Debug .zip, I will shamelessly copy it.
Logged

krafs

  • Drifter
  • **
  • Posts: 42
  • Maker
    • View Profile
Re: [TOOL] GitHub Actions - Workflow to compile mods online
« Reply #2 on: December 02, 2019, 04:21:53 PM »

If you make a workflow that puts together a Release .zip and a Debug .zip, I will shamelessly copy it.

It's less straightforward than just compiling a repository, as I did in RimCI, but I might give it a go.
Will update here if I do.

Feel free to copy and use anything if it's useful :)
Logged

lobz

  • Muffalo
  • *
  • Posts: 11
  • Refugee
    • View Profile
    • my github
Re: [TOOL] GitHub Actions - Workflow to compile mods online
« Reply #3 on: May 29, 2020, 11:01:55 AM »

Hi, I'm new here, and I know this topic hasn't been updated in some time but it's such a useful tool! can someone give a basic explanation of what do I have to do to integrate this in my code? Can I copy the workflow files or is there more to it?

PS.: is there a workflow for integrated automatic testing?
Logged

botlord

  • Muffalo
  • *
  • Posts: 1
  • Refugee
    • View Profile
Re: [TOOL] GitHub Actions - Workflow to compile mods online
« Reply #4 on: July 29, 2020, 06:30:35 PM »

Krafs just merged a couple pull requests from me to update the build so it uses matrix builds instead of individual jobs as well as using dotnet to build. I'm working on a release system as well using a couple other GitHub actions. I think when I'm done, it's basically going to be a new template for creating mods lobz. Though I'll update my release stuff to the original repo as well.
Logged