Sunshine/.github/workflows/pull-requests_build-check.yml

179 lines
7.6 KiB
YAML
Raw Normal View History

2021-12-17 15:55:23 +00:00
name: Build test
on:
pull_request:
branches: [master, nightly]
2021-12-17 15:55:23 +00:00
types: [opened, synchronize, edited, reopened]
workflow_dispatch:
jobs:
build_appimage:
name: AppImage
2021-12-17 15:55:23 +00:00
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Setup Dependencies AppImage
2021-12-17 15:55:23 +00:00
run: |
mkdir -p artifacts
sudo apt-get update -y && \
sudo apt-get --reinstall install -y \
git wget gcc-10 g++-10 build-essential cmake libssl-dev libavdevice-dev libboost-thread-dev libboost-filesystem-dev libboost-log-dev libpulse-dev libopus-dev libxtst-dev libx11-dev libxrandr-dev libxfixes-dev libevdev-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev libdrm-dev libcap-dev libwayland-dev
sudo cp /usr/bin/gcc-10 /usr/bin/gcc && sudo cp /usr/bin/g++-10 /usr/bin/gcc-10
sudo wget https://developer.download.nvidia.com/compute/cuda/11.4.2/local_installers/cuda_11.4.2_470.57.02_linux.run --progress=bar:force:noscroll -q --show-progress -O /root/cuda.run && sudo chmod a+x /root/cuda.run
sudo /root/cuda.run --silent --toolkit --toolkitpath=/usr --no-opengl-libs --no-man-page --no-drm && sudo rm /root/cuda.run
sudo add-apt-repository ppa:savoury1/graphics -y
sudo add-apt-repository ppa:savoury1/multimedia -y
sudo add-apt-repository ppa:savoury1/ffmpeg4 -y
sudo apt-get update -y
sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y
sudo apt-get install ffmpeg -y
- name: Build AppImage
2021-12-17 15:55:23 +00:00
run: |
CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-Release}"
SUNSHINE_EXECUTABLE_PATH="${SUNSHINE_EXECUTABLE_PATH:-/usr/bin/sunshine}"
SUNSHINE_ASSETS_DIR="${SUNSHINE_ASSETS_DIR:-sunshine.AppImage.config}"
SUNSHINE_ENABLE_WAYLAND=${SUNSHINE_ENABLE_WAYLAND:-ON}
SUNSHINE_ENABLE_X11=${SUNSHINE_ENABLE_X11:-ON}
SUNSHINE_ENABLE_DRM=${SUNSHINE_ENABLE_DRM:-ON}
SUNSHINE_ENABLE_CUDA=${SUNSHINE_ENABLE_CUDA:-ON}
mkdir -p appimage-build && cd appimage-build
cmake "-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE" "-DSUNSHINE_EXECUTABLE_PATH=$SUNSHINE_EXECUTABLE_PATH" "-DSUNSHINE_ASSETS_DIR=$SUNSHINE_ASSETS_DIR" "-DSUNSHINE_ENABLE_WAYLAND=$SUNSHINE_ENABLE_WAYLAND" "-DSUNSHINE_ENABLE_X11=$SUNSHINE_ENABLE_X11" "-DSUNSHINE_ENABLE_DRM=$SUNSHINE_ENABLE_DRM" "-DSUNSHINE_ENABLE_CUDA=$SUNSHINE_ENABLE_CUDA" "../" -DCMAKE_INSTALL_PREFIX=/usr
2021-12-17 15:55:23 +00:00
make -j ${nproc} DESTDIR=AppDir
- name: Package AppImage
2021-12-17 15:55:23 +00:00
# https://docs.appimage.org/packaging-guide/index.html
run: |
mkdir -p appimage_temp && cd appimage_temp
2021-12-17 15:55:23 +00:00
DESKTOP_FILE="${DESKTOP_FILE:-sunshine.desktop}"
ICON_FILE="${ICON_FILE:-sunshine.png}"
CONFIG_DIR="${CONFIG_DIR:-sunshine/sunshine.AppImage.config/}"
HOME_DIR="${HOME_DIR:-sunshine/sunshine.AppImage.home/}"
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage && chmod +x linuxdeploy-x86_64.AppImage
./linuxdeploy-x86_64.AppImage --appdir ../AppDir -e ../appimage-build/sunshine -i "../$ICON_FILE" -d "../$DESKTOP_FILE" --output appimage
2021-12-17 15:55:23 +00:00
mv sunshine*.AppImage sunshine.AppImage
mkdir sunshine && mv sunshine.AppImage sunshine/
./sunshine/sunshine.AppImage --appimage-portable-config
./sunshine/sunshine.AppImage --appimage-portable-home
cp -r ../assets/* "$CONFIG_DIR"
rm -f "$CONFIG_DIR"/apps_windows.json
mkdir -p ./"$HOME_DIR"/.config/"$CONFIG_DIR"
cp ./"$CONFIG_DIR"/apps_linux.json ./"$HOME_DIR"/.config/"$CONFIG_DIR"
2021-12-17 15:55:23 +00:00
zip -r ./sunshine_linux.zip ./sunshine/*
mv sunshine_linux.zip ../artifacts/
2021-12-17 15:55:23 +00:00
- name: Verify AppImage
run: |
cd appimage_temp
wget https://github.com/TheAssassin/appimagelint/releases/download/continuous/appimagelint-x86_64.AppImage && chmod +x appimagelint-x86_64.AppImage && ./appimagelint-x86_64.AppImage ./sunshine/sunshine.AppImage
2021-12-17 15:55:23 +00:00
- name: Upload Artifacts
2021-12-18 16:03:56 +00:00
if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
uses: actions/upload-artifact@v2
2021-12-17 15:55:23 +00:00
with:
name: sunshine-AppImage
2021-12-17 15:55:23 +00:00
path: artifacts/
build_deb:
name: deb
runs-on: ubuntu-20.04
strategy:
2021-12-19 15:40:11 +00:00
fail-fast: false
matrix:
2021-12-19 15:45:29 +00:00
distro: [ debian, fedora_33, fedora_35, ubuntu_18_04, ubuntu_20_04, ubuntu_21_04, ubuntu_21_10 ]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Setup Container deb
run: |
mkdir -p artifacts
cd scripts
2021-12-18 16:41:06 +00:00
sudo ./build-container.sh -c build -f Dockerfile-${{ matrix.distro }} -n sunshine-${{ matrix.distro }}
- name: Build deb
run: |
cd scripts
sudo ./build-sunshine.sh -p -u -n sunshine-${{ matrix.distro }} -s ..
- name: Package deb
run: |
cd scripts
sudo mv ./sunshine-${{ matrix.distro }}-build/sunshine-${{ matrix.distro }}.deb ../artifacts/
- name: Upload Artifacts
2021-12-18 16:03:56 +00:00
if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
uses: actions/upload-artifact@v2
with:
name: sunshine-${{ matrix.distro }}
path: artifacts/
build_win:
name: Windows
runs-on: windows-2019
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install boost
uses: MarkusJx/install-boost@v2.0.0
id: install-boost
with:
# REQUIRED: Specify the required boost version
# A list of supported versions can be found here:
# https://github.com/actions/boost-versions/blob/main/versions-manifest.json
2021-12-19 05:04:20 +00:00
boost_version: 1.77.0
# OPTIONAL: Specify a custom install location
boost_install_dir: 'C:'
# OPTIONAL: Specify a platform version
platform_version: 2019
# NOTE: If a boost version matching all requirements cannot be found,
# this build step will fail
- name: Setup Windows
run: |
C:\msys64\usr\bin\bash -lc "pacman --needed --noconfirm -S mingw-w64-x86_64-binutils mingw-w64-x86_64-openssl mingw-w64-x86_64-cmake mingw-w64-x86_64-toolchain mingw-w64-x86_64-opus mingw-w64-x86_64-x265 mingw-w64-x86_64-boost git yasm nasm diffutils make"
- name: Build Windows
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
run: |
mkdir sunshine-windows-build && cd sunshine-windows-build
2021-12-19 04:44:02 +00:00
set PATH=C:\msys64\mingw64\bin
2021-12-19 05:04:20 +00:00
set BOOST_ROOT=C:\boost
set BOOST_INCLUDEDIR=C:\boost
set BOOST_LIBRARYDIR=C:\boost\lib
2021-12-19 15:40:11 +00:00
cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_ASSETS_DIR=assets -G "MinGW Makefiles" ..
mingw32-make -j2
- name: Package Windows
run: |
cd sunshine-windows-build
Del ..\assets\apps_linux.json
7z a Sunshine-Windows.zip ..\assets
7z a Sunshine-Windows.zip sunshine.exe
7z a Sunshine-Windows.zip tools\dxgi-info.exe
7z a Sunshine-Windows.zip tools\audio-info.exe
7z a Sunshine-Windows.zip tools\sunshinesvc.exe
7z a Sunshine-Windows.zip ..\tools\install-service.bat
7z a Sunshine-Windows.zip ..\tools\uninstall-service.bat
- name: Upload Artifacts
if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
uses: actions/upload-artifact@v2
with:
name: Windows
path: sunshine-windows-build/Sunshine-Windows.zip