15 runs-on: ubuntu-latest
17 # manylinux_2_28 is based on AlmaLinux 8, and already has a lot of things
18 # installed and preconfigured. It makes it easier to build OpenTTD.
19 # This distro is based on glibc 2.28, released in 2018.
20 image: quay.io/pypa/manylinux_2_28_x86_64
23 - name: Download source
24 uses: actions/download-artifact@v4
30 tar -xf source.tar.gz --strip-components=1
32 - name: Install Rust toolchain
33 uses: dtolnay/rust-toolchain@stable
35 - name: Enable Rust cache
36 uses: Swatinem/rust-cache@v2
38 - name: Setup vcpkg caching
39 uses: actions/github-script@v7
42 core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
43 core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
44 core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
46 - name: Install dependencies
48 echo "::group::Install system dependencies"
49 # perl-IPC-Cmd, wget, and zip are needed to run vcpkg.
50 # autoconf-archive is needed to build ICU.
58 # aclocal looks first in /usr/local/share/aclocal, and if that doesn't
59 # exist only looks in /usr/share/aclocal. We have files in both that
60 # are important. So copy the latter to the first, and we are good to
62 cp /usr/share/aclocal/* /usr/local/share/aclocal/
65 # The yum variant of fluidsynth depends on all possible audio drivers,
66 # like jack, ALSA, pulseaudio, etc. This is not really useful for us,
67 # as we route the output of fluidsynth back via our sound driver, and
68 # as such do not use these audio driver outputs at all.
69 # The vcpkg variant of fluidsynth depends on ALSA. Similar issue here.
70 # So instead, we compile fluidsynth ourselves, with as few
71 # dependencies as possible. We do it before anything else is installed,
72 # to make sure it doesn't pick up on any of the drivers.
73 echo "::group::Install fluidsynth"
74 wget https://github.com/FluidSynth/fluidsynth/archive/v2.3.3.tar.gz
80 cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr
81 cmake --build . -j $(nproc)
85 echo "::group::Install audio drivers"
86 # These audio libs are to make sure the SDL version of vcpkg adds
87 # sound-support; these libraries are not added to the resulting
88 # binary, but the headers are used to enable them in SDL.
91 pulseaudio-libs-devel \
95 echo "::group::Install video drivers"
96 # These video libs are to make sure the SDL version of vcpkg adds
97 # video-support; these libraries are not added to the resulting
98 # binary, but the headers are used to enable them in SDL.
107 libXScrnSaver-devel \
112 wayland-protocols-devel \
116 # We use vcpkg for our dependencies, to get more up-to-date version.
117 echo "::group::Install vcpkg and dependencies"
119 git clone https://github.com/microsoft/vcpkg /vcpkg
123 ./bootstrap-vcpkg.sh -disableMetrics
126 echo "::group::Install breakpad dependencies"
127 cargo install --locked dump_syms
130 - name: Install GCC problem matcher
131 uses: ammaraskar/gcc-problem-matcher@master
138 echo "::group::CMake"
139 cmake ${GITHUB_WORKSPACE} \
140 -DCMAKE_TOOLCHAIN_FILE=/vcpkg/scripts/buildsystems/vcpkg.cmake \
141 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
142 -DOPTION_SURVEY_KEY=${{ inputs.survey_key }} \
143 -DOPTION_PACKAGE_DEPENDENCIES=ON \
147 echo "::group::Build"
148 echo "Running on $(nproc) cores"
149 cmake --build . -j $(nproc) --target openttd
152 - name: Create breakpad symbols
155 dump_syms ./openttd --inlines --store symbols
157 - name: Create bundles
159 cd ${GITHUB_WORKSPACE}/build
160 echo "::group::Run CPack"
164 echo "::group::Cleanup"
165 # Remove the sha256 files CPack generates; we will do this ourself at
166 # the end of this workflow.
167 rm -f bundles/*.sha256
170 - name: Store bundles
171 uses: actions/upload-artifact@v4
173 name: openttd-linux-generic
177 - name: Store symbols
178 uses: actions/upload-artifact@v4
180 name: symbols-linux-generic