Skip to content

Add Linux Build Github Action #2979

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: development
Choose a base branch
from

Conversation

NickTyrer
Copy link
Contributor

🍰 Pullrequest

Add linux build to github actions. I have very limited knowledge in this area so this will need reviewing to make sure it is correct.

@ratkosrb
Copy link
Contributor

@mserajnik Can you review this since you've worked on the workflows before?

@mserajnik
Copy link
Contributor

@ratkosrb Sure, I'll have a closer look later today.

@mserajnik
Copy link
Contributor

mserajnik commented Mar 27, 2025

The workflow as such seems fine, here is a link to the resulting artifact from a test run I did on my fork.

  1. This is compiled on Ubuntu and linked to Ubuntu-specific dependency versions, meaning this won't just run on any Linux distribution that is not at least Ubuntu-based
  2. It's a dynamic build, so even if the user is on Ubuntu, he'll still need to install the runtime dependencies

Static linking would address both of these issues, but I am not sure how feasible this is; I frankly don't have any experience with static linking on Linux.

I think a better approach for Linux would be to offer an AppImage or a Flatpak (Edit: AppImage is probably the saner choice as connecting to a MySQL DB on the host would be a bit of a pain with Flatpak) as those are self-contained and will work on any distro.

Ultimately, it would of course be easiest to just leave the distribution for Linux to the distros/distro communities. E.g., for Arch there is this AUR package.

@NickTyrer
Copy link
Contributor Author

NickTyrer commented Mar 28, 2025

Thanks for the review. Here is my reasoning behind adding Linux binaries to the releases, I just want a centralised method to obtain the vmangos binaries without the need to compile or rely on third party sources. I would run the binaries using docker, something like:

    image: ubuntu:noble
    container_name: mangosd
    environment:
      - TZ=GB
    ulimits:
      nofile: 1024
    tty: true
    stdin_open: true
    stop_grace_period: 2m
    depends_on:
      mangos_db:
        condition: service_healthy
    restart: unless-stopped
    volumes:
      - mangosd_volume:/vmangos/bin
      - /home/vmangos/mangosd_config:/vmangos/etc
      - /home/vmangos/data:/vmangos/data
      - /home/vmangos/logs:/vmangos/logs
      - /home/vmangos/honor:/vmangos/honor
    command:
      - /bin/bash
      - -c
      - |
        export DEBIAN_FRONTEND=noninteractive
        apt-get -qq update
        apt-get -qq -y install libace-dev libtbb-dev libmysqlclient-dev curl
        [ ! -f /vmangos/bin/mangosd ] && curl -L --create-dirs --output /vmangos/bin/mangosd "https://github.com/vmangos/core/releases/download/latest/mangosd"
        [ ! -f /vmangos/etc/mangosd.conf ] && curl -L --create-dirs --output /vmangos/etc/mangosd.conf "https://github.com/vmangos/core/releases/download/latest/mangosd.conf"
        chmod +x /vmangos/bin/mangosd
        ./vmangos/bin/mangosd
    network_mode: service:mangos_db

Maybe its too niche but it would be usefull for me to quickly setup a disposable dev environment (I only do SQL work).

@NickTyrer
Copy link
Contributor Author

Also I looked into creating standalone binaries using static linking but it is way beyond me.

@mserajnik
Copy link
Contributor

I just want a centralised method to obtain the vmangos binaries without the need to compile or rely on third party sources. I would run the binaries using docker

Shameless plug: Maybe my Docker setup might be useful for this. You’d still be relying on a third party, but I plan to keep on maintaining it indefinitely.

Other than that, I don’t think there’s a downside to adding this workflow; but maybe the limitations of these builds should be documented somewhere so Linux users don’t just assume the binaries will work on their system without any extra work on their end.

@NickTyrer
Copy link
Contributor Author

Nice work with vmangos-deploy, I just like the guarantee that having the binaries attached to the main repo will result in them always being up to date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants