2022-02-06 22:32:55 +00:00
name : CI
2021-12-17 15:55:23 +00:00
on :
pull_request :
2021-12-17 22:36:11 +00:00
branches : [ master, nightly]
2021-12-17 15:55:23 +00:00
types : [ opened, synchronize, edited, reopened]
2022-01-11 02:11:44 +00:00
push :
2022-01-11 15:01:43 +00:00
branches : [ master]
2021-12-17 15:55:23 +00:00
workflow_dispatch :
jobs :
2022-01-11 22:40:58 +00:00
check_changelog :
name : Check Changelog
runs-on : ubuntu-latest
steps :
2022-01-11 23:55:58 +00:00
- name : Checkout
uses : actions/checkout@v2
2022-01-11 22:40:58 +00:00
- name : Verify Changelog
id : verify_changelog
2022-01-11 23:35:05 +00:00
if : ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }}
# base_ref for pull request check, ref for push
2022-01-16 00:19:15 +00:00
uses : SunshineStream/actions/verify_changelog@master
2022-01-11 22:40:58 +00:00
with :
token : ${{ secrets.GITHUB_TOKEN }}
outputs :
next_version : ${{ steps.verify_changelog.outputs.changelog_parser_version }}
2022-02-13 17:07:10 +00:00
next_version_bare : ${{ steps.verify_changelog.outputs.changelog_parser_version_bare }}
2022-01-11 22:40:58 +00:00
last_version : ${{ steps.verify_changelog.outputs.latest_release_tag_name }}
release_body : ${{ steps.verify_changelog.outputs.changelog_parser_description }}
2022-02-13 17:07:10 +00:00
check_versions :
name : Check Versions
runs-on : ubuntu-latest
needs : check_changelog
if : ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }}
# base_ref for pull request check, ref for push
steps :
- name : Checkout
uses : actions/checkout@v2
- name : Check CMakeLists.txt Version
run : |
version=$(grep -o -E '^project\(Sunshine VERSION [0-9]+\.[0-9]+\.[0-9]+\)' CMakeLists.txt | grep -o -E '[0-9]+\.[0-9]+\.[0-9]+')
echo "cmakelists_version=${version}" >> $GITHUB_ENV
- name : Compare CMakeList.txt Version
if : ${{ env.cmakelists_version != needs.check_changelog.outputs.next_version_bare }}
run : |
echo CMakeLists version : "$cmakelists_version"
echo Changelog version : "${{ needs.check_changelog.outputs.next_version_bare }}"
echo Within 'CMakeLists.txt' change "project(Sunshine VERSION $cmakelists_version)" to "project(Sunshine VERSION ${{ needs.check_changelog.outputs.next_version_bare }})"
exit 1
- name : Check gen-deb.in Version
run : |
version=$(grep -o -E '^Version : [ 0 -9 ] +\.[0-9]+\.[0-9]+' gen-deb.in | grep -o -E '[0-9]+\.[0-9]+\.[0-9]+')
echo "gendeb_version=${version}" >> $GITHUB_ENV
- name : Compare gen-deb.in Version
if : ${{ env.gendeb_version != needs.check_changelog.outputs.next_version_bare }}
run : |
echo gen-deb.in version : "$gendeb_version"
echo Changelog version : "${{ needs.check_changelog.outputs.next_version_bare }}"
echo Within 'gen-deb.in' change "Version: $gendeb_version" to "Version: ${{ needs.check_changelog.outputs.next_version_bare }}"
exit 1
- name : Check sunshine.desktop Versions
run : |
2022-02-13 17:45:13 +00:00
version=$(grep -o -E '^X-AppImage-Version=[0-9]+\.[0-9]+\.[0-9]+' sunshine.desktop | grep -o -E '[0-9]+\.[0-9]+\.[0-9]+')
2022-02-13 17:07:10 +00:00
echo "appimage_version=${version}" >> $GITHUB_ENV
- name : Compare sunshine.desktop Versions
2022-02-13 17:45:13 +00:00
if : ${{ env.appimage_version != needs.check_changelog.outputs.next_version_bare }}
2022-02-13 17:07:10 +00:00
run : |
echo sunshine.desktop Version : "$appimage_version"
echo Changelog version : "${{ needs.check_changelog.outputs.next_version_bare }}"
2022-02-13 17:45:13 +00:00
echo Within 'sunshine.desktop' change "X-AppImage-Version=$appimage_version" to "X-AppImage-Version=${{ needs.check_changelog.outputs.next_version_bare }}"
2022-02-13 17:07:10 +00:00
exit 1
2021-12-18 03:00:37 +00:00
build_appimage :
name : AppImage
2021-12-17 15:55:23 +00:00
runs-on : ubuntu-20.04
2022-02-13 17:17:04 +00:00
needs : check_changelog
2021-12-17 15:55:23 +00:00
steps :
2021-12-17 19:15:23 +00:00
- name : Checkout
uses : actions/checkout@v2
with :
2021-12-17 22:36:11 +00:00
submodules : recursive
2021-12-17 19:15:23 +00:00
2021-12-18 03:00:37 +00:00
- 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
2022-01-11 02:11:44 +00:00
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10
2021-12-17 15:55:23 +00:00
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
2021-12-17 19:15:23 +00:00
- 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
2021-12-17 18:30:19 +00:00
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
2022-02-13 17:45:13 +00:00
- name : Set AppImage Version
if : ${{ needs.check_changelog.outputs.next_version_bare != needs.check_changelog.outputs.latest_version }}
run : |
version=${{ needs.check_changelog.outputs.next_version_bare }}
echo "VERSION=${version}" >> $GITHUB_ENV
2021-12-17 19:15:23 +00:00
- name : Package AppImage
2021-12-17 15:55:23 +00:00
# https://docs.appimage.org/packaging-guide/index.html
run : |
2021-12-17 18:30:19 +00:00
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
2021-12-17 18:30:19 +00:00
./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
2021-12-17 18:30:19 +00:00
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/*
2021-12-17 18:30:19 +00:00
mv sunshine_linux.zip ../artifacts/
2021-12-17 15:55:23 +00:00
- name : Verify AppImage
run : |
2021-12-17 18:30:19 +00:00
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' }}
2021-12-17 15:59:55 +00:00
uses : actions/upload-artifact@v2
2021-12-17 15:55:23 +00:00
with :
2021-12-18 03:00:37 +00:00
name : sunshine-AppImage
2021-12-17 15:55:23 +00:00
path : artifacts/
2022-01-11 02:11:44 +00:00
- name : Create Release
2022-01-11 22:40:58 +00:00
if : ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
2022-01-11 05:14:49 +00:00
uses : SunshineStream/actions/create_release@v0
2022-01-11 05:04:13 +00:00
with :
token : ${{ secrets.GITHUB_TOKEN }}
2022-01-11 22:40:58 +00:00
next_version : ${{ needs.check_changelog.outputs.next_version }}
last_version : ${{ needs.check_changelog.outputs.last_version }}
release_body : ${{ needs.check_changelog.outputs.release_body }}
2022-01-11 02:11:44 +00:00
2021-12-19 20:04:54 +00:00
build_linux :
name : Linux
2021-12-18 03:00:37 +00:00
runs-on : ubuntu-20.04
2022-02-13 17:17:04 +00:00
needs : check_changelog
2021-12-18 03:00:37 +00:00
strategy :
2022-01-11 15:18:52 +00:00
fail-fast : true # false to test all, true to fail entire job if any fail
2021-12-18 03:00:37 +00:00
matrix :
2022-01-11 15:18:52 +00:00
distro : [ debian, ubuntu_20_04, ubuntu_21_04, ubuntu_21_10 ] # removed ubuntu_18_04 for now
2022-01-11 14:46:18 +00:00
package : [ -p ]
2022-01-11 15:18:52 +00:00
include : # don't package these
2022-01-11 14:46:18 +00:00
- distro : fedora_33
package : ''
- distro : fedora_35
package : ''
2021-12-18 03:00:37 +00:00
steps :
- name : Checkout
uses : actions/checkout@v2
with :
submodules : recursive
2021-12-19 20:39:39 +00:00
- name : Setup Container
2021-12-18 03:00:37 +00:00
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 }}
2021-12-19 20:39:39 +00:00
- name : Build Linux
2021-12-18 21:51:49 +00:00
run : |
cd scripts
2022-01-11 14:46:18 +00:00
sudo ./build-sunshine.sh ${{ matrix.package }} -u -n sunshine-${{ matrix.distro }} -s ..
2021-12-19 20:39:39 +00:00
- name : Package Linux
2022-01-11 14:46:18 +00:00
if : ${{ matrix.package == '-p' }}
2021-12-18 21:51:49 +00:00
run : |
cd scripts
2021-12-18 22:01:54 +00:00
sudo mv ./sunshine-${{ matrix.distro }}-build/sunshine-${{ matrix.distro }}.deb ../artifacts/
2021-12-18 03:00:37 +00:00
- name : Upload Artifacts
2022-01-11 14:46:18 +00:00
if : ${{ matrix.package == '-p' && ( github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' ) }}
2021-12-18 03:00:37 +00:00
uses : actions/upload-artifact@v2
with :
name : sunshine-${{ matrix.distro }}
path : artifacts/
2022-01-11 02:11:44 +00:00
- name : Create Release
2022-01-11 14:46:18 +00:00
if : ${{ matrix.package == '-p' && github.event_name == 'push' && github.ref == 'refs/heads/master' }}
2022-01-11 05:14:49 +00:00
uses : SunshineStream/actions/create_release@v0
2022-01-11 05:04:13 +00:00
with :
token : ${{ secrets.GITHUB_TOKEN }}
2022-01-11 22:40:58 +00:00
next_version : ${{ needs.check_changelog.outputs.next_version }}
last_version : ${{ needs.check_changelog.outputs.last_version }}
release_body : ${{ needs.check_changelog.outputs.release_body }}
2021-12-18 22:36:39 +00:00
build_win :
name : Windows
runs-on : windows-2019
2022-02-13 17:17:04 +00:00
needs : check_changelog
2021-12-18 22:36:39 +00:00
steps :
- name : Checkout
uses : actions/checkout@v2
with :
submodules : recursive
2021-12-24 10:27:40 +00:00
- name : MSYS2 Setup
uses : msys2/setup-msys2@v2
2021-12-21 02:31:22 +00:00
with :
2021-12-24 10:27:40 +00:00
update : true
install : >-
base-devel
git
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
2021-12-18 22:36:39 +00:00
- name : Build Windows
2021-12-24 10:27:40 +00:00
shell : msys2 {0}
2021-12-18 22:36:39 +00:00
run : |
mkdir sunshine-windows-build && cd sunshine-windows-build
2021-12-24 11:19:28 +00:00
cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_ASSETS_DIR=assets -G "MinGW Makefiles" ..
2021-12-18 22:36:39 +00:00
mingw32-make -j2
- name : Package Windows
run : |
cd sunshine-windows-build
2022-01-11 23:03:30 +00:00
del ..\assets\apps_linux.json
2021-12-18 22:36:39 +00:00
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
2022-01-11 02:11:44 +00:00
cd ..
mkdir artifacts
2022-01-11 23:03:30 +00:00
move "sunshine-windows-build\Sunshine-Windows.zip" "artifacts"
2021-12-18 22:36:39 +00:00
- name : Upload Artifacts
if : ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
uses : actions/upload-artifact@v2
with :
2022-01-11 02:11:44 +00:00
name : sunshine-${{ runner.os }}
path : artifacts/
- name : Create Release
2022-01-11 22:40:58 +00:00
if : ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
2022-01-11 05:14:49 +00:00
uses : SunshineStream/actions/create_release@v0
2022-01-11 05:04:13 +00:00
with :
token : ${{ secrets.GITHUB_TOKEN }}
2022-01-11 22:40:58 +00:00
next_version : ${{ needs.check_changelog.outputs.next_version }}
last_version : ${{ needs.check_changelog.outputs.last_version }}
release_body : ${{ needs.check_changelog.outputs.release_body }}