Linux CI (#84)

* Linux CI

* misc formatting

* .reuse
This commit is contained in:
qurious-pixel 2024-02-25 07:20:53 -08:00 committed by GitHub
parent 08aba86ca1
commit 6e1f25d99f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 91 additions and 44 deletions

View File

@ -1,43 +0,0 @@
# SPDX-FileCopyrightText: 2024 shadPS4 Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
name: Linux
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install dev packages
run: |
sudo apt install libxext-dev doxygen libgl-dev
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel `nproc`
- name: Upload a Build Artifact
uses: actions/upload-artifact@v3.1.2
with:
name: shadps4-ubuntu64
# A file, directory or wildcard pattern that describes what to upload
path: |
${{github.workspace}}/build/shadps4
${{github.workspace}}/build/libSDL3.so.0.0.0

21
.github/linux-appimage-sdl.sh vendored Executable file
View File

@ -0,0 +1,21 @@
# SPDX-FileCopyrightText: 2024 shadPS4 Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
#!/bin/bash
if [[ -z $GITHUB_WORKSPACE ]]; then
GITHUB_WORKSPACE="${PWD%/*}"
fi
# Prepare Tools for building the AppImage
wget -q https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
wget -q https://github.com/linuxdeploy/linuxdeploy-plugin-checkrt/releases/download/continuous/linuxdeploy-plugin-checkrt-x86_64.sh
chmod a+x linuxdeploy-x86_64.AppImage
chmod a+x linuxdeploy-plugin-checkrt-x86_64.sh
# Build AppImage
./linuxdeploy-x86_64.AppImage --appdir AppDir
./linuxdeploy-plugin-checkrt-x86_64.sh --appdir AppDir
./linuxdeploy-x86_64.AppImage --appdir AppDir -d "$GITHUB_WORKSPACE"/.github/shadps4.desktop -e "$GITHUB_WORKSPACE"/build/shadps4 -i "$GITHUB_WORKSPACE"/.github/shadps4.png --output appimage
mv Shadps4-x86_64.AppImage Shadps4-sdl.AppImage

9
.github/shadps4.desktop vendored Normal file
View File

@ -0,0 +1,9 @@
[Desktop Entry]
Name=Shadps4
Exec=shadps4
Terminal=false
Type=Application
Icon=shadps4
Comment=gui for shadps4
Categories=Game;
StartupWMClass=shadps4;

BIN
.github/shadps4.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

58
.github/workflows/linux.yml vendored Normal file
View File

@ -0,0 +1,58 @@
# SPDX-FileCopyrightText: 2024 shadPS4 Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
name: Linux
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
CLANG_VER: 17
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install misc packages
run: >
sudo apt-get update && sudo apt install libx11-dev libgl1-mesa-glx mesa-common-dev libfuse2 libwayland-dev libxxhash-dev libvulkan-dev
- name: Install newer Clang
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x ./llvm.sh
sudo ./llvm.sh ${{env.CLANG_VER}}
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER=clang-${{env.CLANG_VER}} -DCMAKE_CXX_COMPILER=clang++-${{env.CLANG_VER}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel
- name: Upload executable
uses: actions/upload-artifact@v4
with:
name: shadps4-ubuntu64
path: |
${{github.workspace}}/build/shadps4
${{github.workspace}}/build/libSDL3.so.0.0.0
- name: Run AppImage packaging script
run: ./.github/linux-appimage-sdl.sh
- name: Upload executable
uses: actions/upload-artifact@v4
with:
name: shadps4-sdl-appimage
path: Shadps4-sdl.AppImage

View File

@ -6,5 +6,7 @@ Files: CMakeSettings.json
scripts/ps4_names.txt scripts/ps4_names.txt
documents/changelog.txt documents/changelog.txt
documents/readme.txt documents/readme.txt
.github/shadps4.desktop
.github/shadps4.png
Copyright: shadPS4 Emulator Project Copyright: shadPS4 Emulator Project
License: GPL-2.0-or-later License: GPL-2.0-or-later