Update build-ubuntu.yml #118
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: m8c linux x64 build | |
env: | |
SDL_VERSION: 3.2.6 | |
SDL_SHA256: "096a0b843dd1124afda41c24bd05034af75af37e9a1b9d205cc0a70193b27e1a SDL3-3.2.6.tar.gz" | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build-linux: | |
runs-on: ubuntu-22.04 | |
name: linux-x86_64 | |
steps: | |
- name: 'Install dependencies' | |
run: | | |
sudo apt-get update | |
sudo apt-get install --fix-missing build-essential libserialport-dev zip git make pkg-config cmake ninja-build gnome-desktop-testing libasound2-dev libpulse-dev libaudio-dev libjack-dev libsndio-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev libpipewire-0.3-dev libwayland-dev libdecor-0-dev | |
- name: 'Checkout' | |
uses: actions/checkout@v4 | |
- name: Set current date as env variable | |
run: echo "NOW=$(date +'%Y-%m-%d')" >> $GITHUB_ENV | |
- name: 'Cache SDL3 files' | |
id: cache-x86_64-sdl3-files | |
uses: actions/cache@v4 | |
with: | |
path: 'SDL3-${{ env.SDL_VERSION }}' | |
key: linux-x86_64-sdl3-files | |
- name: 'Download SDL3 sources' | |
if: steps.cache-x86_64-sdl3-files.outputs.cache-hit != 'true' | |
run: | | |
(curl -O https://www.libsdl.org/release/SDL3-$SDL_VERSION.tar.gz || curl -O -L https://github.com/libsdl-org/SDL/releases/download/release-$SDL_VERSION/SDL3-$SDL_VERSION.tar.gz) | |
if ! echo $SDL_SHA256 | sha256sum -c --status -; then echo "SDL archive checksum failed"; exit 1; fi | |
tar zxvf SDL3-$SDL_VERSION.tar.gz | |
- name: 'Build SDL3' | |
if: steps.cache-x86_64-sdl3-files.outputs.cache-hit != 'true' | |
run: | | |
pushd SDL3-$SDL_VERSION | |
mkdir build_x86_64 | |
cmake -S . -B build_x86_64 | |
cmake --build build_x86_64 | |
sudo cmake --install build_x86_64 | |
popd | |
- name: 'Build binary' | |
run: | | |
make | |
- name: 'Upload artifact' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: m8c-${{ env.NOW }}-linux-x86_64 | |
path: | | |
LICENSE | |
README.md | |
AUDIOGUIDE.md | |
m8c | |
gamecontrollerdb.txt | |
- name: 'Build AppImage' | |
run: | | |
bash package/appimage/package.sh | |
- name: 'Upload artifact' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: m8c-${{ env.NOW }}-linux-x86_64.AppImage | |
path: | | |
m8c*.AppImage |