2022-02-06 17:32:55 -05:00
name : CI
2021-12-17 10:55:23 -05:00
on :
pull_request :
2021-12-17 17:36:11 -05:00
branches : [ master, nightly]
2022-04-23 12:35:39 -04:00
types : [ opened, synchronize, reopened]
2022-01-10 21:11:44 -05:00
push :
2022-04-30 12:38:08 -04:00
branches : [ master]
2021-12-17 10:55:23 -05:00
workflow_dispatch :
jobs :
2022-01-11 17:40:58 -05:00
check_changelog :
name : Check Changelog
runs-on : ubuntu-latest
steps :
2022-04-30 09:45:33 +01:00
- name : Checkout
uses : actions/checkout@v3
- name : Verify Changelog
id : verify_changelog
if : ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }}
# base_ref for pull request check, ref for push
uses : SunshineStream/actions/verify_changelog@master
with :
token : ${{ secrets.GITHUB_TOKEN }}
2022-01-11 17:40:58 -05:00
outputs :
next_version : ${{ steps.verify_changelog.outputs.changelog_parser_version }}
2022-02-13 12:07:10 -05:00
next_version_bare : ${{ steps.verify_changelog.outputs.changelog_parser_version_bare }}
2022-01-11 17:40:58 -05:00
last_version : ${{ steps.verify_changelog.outputs.latest_release_tag_name }}
2022-04-30 09:45:33 +01:00
release_body : ${{ steps.verify_changelog.outputs.changelog_parser_description }}
2022-01-11 17:40:58 -05:00
2022-02-13 12:07:10 -05:00
check_versions :
name : Check Versions
runs-on : ubuntu-latest
2022-04-30 12:38:08 -04:00
needs : check_changelog
if : ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }}
# base_ref for pull request check, ref for push
2022-02-13 12:07:10 -05:00
steps :
2022-04-30 09:45:33 +01:00
- name : Checkout
uses : actions/checkout@v3
2022-02-13 12:07:10 -05:00
2022-04-30 09:45:33 +01:00
- 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
2022-02-13 12:07:10 -05:00
2022-04-30 09:45:33 +01:00
- 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
2022-05-06 12:55:43 -04:00
build_linux :
name : Linux
2022-04-29 21:19:05 +01:00
runs-on : ubuntu-20.04
2022-04-30 12:38:08 -04:00
needs : check_changelog
2022-04-29 21:19:05 +01:00
steps :
- name : Checkout
uses : actions/checkout@v3
with :
submodules : recursive
2022-05-06 12:55:43 -04:00
- name : Setup Dependencies Linux
2022-04-29 21:19:05 +01:00
run : |
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 update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-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
2022-05-06 12:55:43 -04:00
- name : Build Linux
2022-04-29 21:19:05 +01:00
run : |
2022-05-06 12:55:43 -04:00
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_CONFIG_DIR=. -DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine -DSUNSHINE_ENABLE_WAYLAND=ON -DSUNSHINE_ENABLE_X11=ON -DSUNSHINE_ENABLE_DRM=ON -DSUNSHINE_ENABLE_CUDA=ON "../"
make -j ${nproc}
2022-04-29 21:19:05 +01:00
2022-04-30 09:45:33 +01: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
2022-04-30 12:38:08 -04:00
2022-05-06 12:55:43 -04:00
- name : Package Linux
2022-04-30 09:45:33 +01:00
run : |
2022-04-30 17:51:14 -04:00
mkdir -p artifacts
2022-05-06 12:55:43 -04:00
cd build
# variables
2022-04-30 09:45:33 +01:00
DESKTOP_FILE="${DESKTOP_FILE:-sunshine.desktop}"
ICON_FILE="${ICON_FILE:-sunshine.png}"
2022-05-06 12:55:43 -04:00
# AppImage
# https://docs.appimage.org/packaging-guide/index.html
2022-04-30 09:45:33 +01:00
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage && chmod +x linuxdeploy-x86_64.AppImage
2022-05-06 12:55:43 -04:00
./linuxdeploy-x86_64.AppImage --appdir . -e ./sunshine -i "../$ICON_FILE" -d "./$DESKTOP_FILE" --output appimage
2022-04-30 12:38:08 -04:00
2022-05-06 12:55:43 -04:00
# package
cpack -G DEB
cpack -G RPM
2022-05-05 22:17:07 -04:00
2022-05-06 12:55:43 -04:00
# move
2022-05-05 22:17:07 -04:00
mv sunshine*.AppImage ../artifacts/sunshine.AppImage
2022-05-06 12:55:43 -04:00
mv ./cpack_artifacts/Sunshine.deb ../artifacts/sunshine.deb
mv ./cpack_artifacts/Sunshine.rpm ../artifacts/sunshine.rpm
2021-12-17 10:55:23 -05:00
2022-04-30 09:45:33 +01:00
- name : Verify AppImage
run : |
2022-05-06 12:55:43 -04:00
wget https://github.com/TheAssassin/appimagelint/releases/download/continuous/appimagelint-x86_64.AppImage
chmod +x appimagelint-x86_64.AppImage
2022-04-30 09:45:33 +01:00
2022-05-06 12:55:43 -04:00
./appimagelint-x86_64.AppImage ./artifacts/sunshine.AppImage
2022-04-30 09:45:33 +01:00
2022-04-30 12:38:08 -04:00
- name : Upload Artifacts
if : ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
2022-04-29 21:19:05 +01:00
uses : actions/upload-artifact@v3
with :
2022-04-30 12:38:08 -04:00
name : sunshine-linux
path : artifacts/
- name : Create Release
if : ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
uses : SunshineStream/actions/create_release@master
2022-04-30 10:02:26 +01:00
with :
2022-04-30 12:38:08 -04:00
token : ${{ secrets.GITHUB_TOKEN }}
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 17:36:39 -05:00
2022-04-30 19:20:16 -04:00
build_mac :
name : MacOS
runs-on : macos-11
needs : check_changelog
steps :
- name : Checkout
uses : actions/checkout@v3
with :
submodules : recursive
- name : Setup Dependencies MacOS
run : |
# install dependencies using homebrew
brew install boost cmake ffmpeg opus
# fix openssl header not found
cd /usr/local/include
ln -s ../opt/openssl/include/openssl .
- name : Build MacOS
run : |
mkdir build
cd build
2022-05-06 12:55:43 -04:00
cmake -DCMAKE_BUILD_TYPE=Release ..
2022-04-30 19:20:16 -04:00
make -j ${nproc}
- name : Package MacOS
run : |
mkdir -p artifacts
cd build
# package
cpack -G DragNDrop
2022-05-05 19:49:16 -04:00
cpack -G ZIP
2022-04-30 19:20:16 -04:00
# move
2022-05-05 21:05:57 -04:00
mv Portfile ../artifacts/Portfile
2022-05-06 12:55:43 -04:00
mv ./cpack_artifacts/Sunshine.dmg ../artifacts/sunshine-macos.dmg
mv ./cpack_artifacts/Sunshine.zip ../artifacts/sunshine-macos.zip
2022-04-30 19:20:16 -04:00
- name : Upload Artifacts
if : ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
uses : actions/upload-artifact@v3
with :
name : sunshine-macos
path : artifacts/
- name : Create Release
if : ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
uses : SunshineStream/actions/create_release@master
with :
token : ${{ secrets.GITHUB_TOKEN }}
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 17:36:39 -05:00
build_win :
name : Windows
runs-on : windows-2019
2022-04-30 12:38:08 -04:00
needs : check_changelog
2021-12-18 17:36:39 -05:00
steps :
- name : Checkout
2022-03-02 12:36:17 +00:00
uses : actions/checkout@v3
2021-12-18 17:36:39 -05:00
with :
submodules : recursive
2022-04-30 09:45:33 +01:00
2022-04-30 12:38:08 -04:00
- name : Setup Dependencies Windows
2021-12-24 11:27:40 +01:00
uses : msys2/setup-msys2@v2
2021-12-20 21:31:22 -05:00
with :
2021-12-24 11:27:40 +01:00
update : true
install : >-
base-devel
2022-04-30 12:38:08 -04:00
diffutils
2021-12-24 11:27:40 +01:00
git
2022-04-30 12:38:08 -04:00
make
2021-12-24 11:27:40 +01:00
mingw-w64-x86_64-binutils
2022-04-30 12:38:08 -04:00
mingw-w64-x86_64-boost
2021-12-24 11:27:40 +01:00
mingw-w64-x86_64-cmake
2022-04-30 12:38:08 -04:00
mingw-w64-x86_64-nsis
mingw-w64-x86_64-openssl
mingw-w64-x86_64-opus
2021-12-24 11:27:40 +01:00
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-x265
2022-04-30 12:38:08 -04:00
nasm
yasm
2022-04-30 09:45:33 +01:00
2021-12-18 17:36:39 -05:00
- name : Build Windows
2021-12-24 11:27:40 +01:00
shell : msys2 {0}
2022-04-30 09:45:33 +01:00
run : |
2022-04-30 12:38:08 -04:00
mkdir build
cd build
2022-05-06 12:55:43 -04:00
cmake -DCMAKE_BUILD_TYPE=Release -G "MinGW Makefiles" ..
2021-12-18 17:36:39 -05:00
mingw32-make -j2
2022-04-30 19:06:19 -04:00
2022-04-30 12:38:08 -04:00
- name : Package Windows
2022-04-29 21:19:05 +01:00
shell : msys2 {0}
run : |
2022-04-30 12:38:08 -04:00
mkdir -p artifacts
cd build
# package
2022-05-05 22:17:07 -04:00
cpack -G NSIS
2022-04-30 10:02:26 +01:00
cpack -G ZIP
2022-04-30 12:38:08 -04:00
# move
2022-05-06 12:55:43 -04:00
mv ./cpack_artifacts/Sunshine.exe ../artifacts/sunshine-windows.exe
mv ./cpack_artifacts/Sunshine.zip ../artifacts/sunshine-windows.zip
2022-04-30 10:02:26 +01:00
2022-04-30 12:38:08 -04:00
- name : Upload Artifacts
2022-04-29 21:19:05 +01:00
if : ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
uses : actions/upload-artifact@v3
with :
2022-04-30 12:38:08 -04:00
name : sunshine-windows
path : artifacts/
2022-04-30 09:45:33 +01:00
2022-01-10 21:11:44 -05:00
- name : Create Release
2022-01-11 17:40:58 -05:00
if : ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
2022-02-27 12:21:23 -05:00
uses : SunshineStream/actions/create_release@master
2022-01-11 00:04:13 -05:00
with :
token : ${{ secrets.GITHUB_TOKEN }}
2022-01-11 17:40:58 -05:00
next_version : ${{ needs.check_changelog.outputs.next_version }}
last_version : ${{ needs.check_changelog.outputs.last_version }}
2022-04-30 12:38:08 -04:00
release_body : ${{ needs.check_changelog.outputs.release_body }}