CI: use cpack for windows 7Z, split back deb/rpm and appimage, moved release action at the end

This commit is contained in:
ABeltramo
2022-04-30 09:45:33 +01:00
parent 6858f9c8d4
commit 5eb3e7c75f

View File

@@ -5,7 +5,7 @@ on:
branches: [master, nightly] branches: [master, nightly]
types: [opened, synchronize, reopened] types: [opened, synchronize, reopened]
push: push:
branches: [master] branches: [ master ]
workflow_dispatch: workflow_dispatch:
jobs: jobs:
@@ -41,6 +41,7 @@ jobs:
run: | 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]+') 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 echo "cmakelists_version=${version}" >> $GITHUB_ENV
- name: Compare CMakeList.txt Version - name: Compare CMakeList.txt Version
if: ${{ env.cmakelists_version != needs.check_changelog.outputs.next_version_bare }} if: ${{ env.cmakelists_version != needs.check_changelog.outputs.next_version_bare }}
run: | run: |
@@ -49,26 +50,97 @@ jobs:
echo Within 'CMakeLists.txt' change "project(Sunshine VERSION $cmakelists_version)" to "project(Sunshine 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 exit 1
build_linux: build_appimage:
name: Build Sunshine on Linux name: AppImage
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
needs: [check_versions, check_changelog] needs: check_changelog
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
submodules: recursive submodules: recursive
- name: Cache Sunshine build - name: Setup Dependencies AppImage
uses: actions/cache@v2
with:
path: build
key: ${{ runner.os }}-sunshine-build
- name: Setup Dependencies
run: | run: |
mkdir -p artifacts 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 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
- name: Build AppImage
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
make -j ${nproc} DESTDIR=AppDir
- 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
- name: Package AppImage
# https://docs.appimage.org/packaging-guide/index.html
run: |
mkdir -p appimage_temp && cd appimage_temp
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 "../appimage-build/$DESKTOP_FILE" --output appimage
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"
zip -r ./sunshine-appimage.zip ./sunshine/*
mv sunshine-appimage.zip ../artifacts/
- 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
- name: Upload Artifacts
if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
uses: actions/upload-artifact@v3
with:
name: sunshine-appimage
path: artifacts/
build_linux:
name: Linux
runs-on: ubuntu-20.04
needs: check_changelog
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Dependencies AppImage
run: |
mkdir -p artifacts
sudo apt-get update -y && \ sudo apt-get update -y && \
sudo apt-get --reinstall install -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 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
@@ -86,142 +158,48 @@ jobs:
run: | run: |
CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-Release}" CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-Release}"
SUNSHINE_EXECUTABLE_PATH="${SUNSHINE_EXECUTABLE_PATH:-/usr/bin/sunshine}" 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_WAYLAND=${SUNSHINE_ENABLE_WAYLAND:-ON}
SUNSHINE_ENABLE_X11=${SUNSHINE_ENABLE_X11:-ON} SUNSHINE_ENABLE_X11=${SUNSHINE_ENABLE_X11:-ON}
SUNSHINE_ENABLE_DRM=${SUNSHINE_ENABLE_DRM:-ON} SUNSHINE_ENABLE_DRM=${SUNSHINE_ENABLE_DRM:-ON}
SUNSHINE_ENABLE_CUDA=${SUNSHINE_ENABLE_CUDA:-ON} SUNSHINE_ENABLE_CUDA=${SUNSHINE_ENABLE_CUDA:-ON}
SUNSHINE_CONFIG_DIR=${SUNSHINE_CONFIG_DIR:-.}
mkdir -p build mkdir -p build
mkdir -p artifacts
cd build cd build
cmake "-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE" "-DSUNSHINE_CONFIG_DIR=$SUNSHINE_CONFIG_DIR" "-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
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 - name: Build DEB
make -j ${nproc} DESTDIR=AppDir
build_appimage:
name: AppImage
runs-on: ubuntu-20.04
needs: build_linux
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Cache Sunshine build
uses: actions/cache@v2
with:
path: build
key: ${{ runner.os }}-sunshine-build
- 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
- name: Package AppImage
# https://docs.appimage.org/packaging-guide/index.html
run: |
mkdir -p appimage_temp && cd appimage_temp
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 ../build/sunshine -i "../$ICON_FILE" -d "../build/$DESKTOP_FILE" --output appimage
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"
zip -r ./sunshine-appimage.zip ./sunshine/*
mv sunshine-appimage.zip ../artifacts/
- 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
- name: Upload Artifacts
if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
uses: actions/upload-artifact@v3
with:
name: sunshine-appimage
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 }}
build_deb_and_rpm:
name: Build DEB and RPM
runs-on: ubuntu-20.04
needs: build_linux
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Cache Sunshine build
uses: actions/cache@v2
with:
path: build
key: ${{ runner.os }}-sunshine-build
- name: Extra dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y cmake # will install cpack
- name: Build DEB and RPM
run: | run: |
cd build cd build
cpack -G DEB cpack -G DEB
mv Sunshine__.deb ../artifacts/
- name: Build RPM
run: |
cd build
cpack -G RPM cpack -G RPM
- name: Upload RPM mv Sunshine__.rpm ../artifacts/
- name: Upload Artifacts
if: ${{ matrix.package == '-p' && ( github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' ) }} if: ${{ matrix.package == '-p' && ( github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' ) }}
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: sunshine-linux-rpm name: sunshine-linux
path: build/Sunshine__.rpm path: artifacts/
- name: Upload DEB
if: ${{ matrix.package == '-p' && ( github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' ) }}
uses: actions/upload-artifact@v3
with:
name: sunshine-linux-deb
path: build/Sunshine__.deb
- name: Create Release
if: ${{ matrix.package == '-p' && 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 }}
build_win: build_win:
name: Windows name: Windows
runs-on: windows-2019 runs-on: windows-2019
needs: [check_versions, check_changelog] needs: [ check_versions, check_changelog ]
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
submodules: recursive submodules: recursive
- name: MSYS2 Setup - name: MSYS2 Setup
uses: msys2/setup-msys2@v2 uses: msys2/setup-msys2@v2
with: with:
@@ -242,6 +220,7 @@ jobs:
nasm nasm
diffutils diffutils
make make
- name: Build Windows - name: Build Windows
shell: msys2 {0} shell: msys2 {0}
run: | run: |
@@ -249,39 +228,33 @@ jobs:
cd sunshine-windows-build cd sunshine-windows-build
cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_ASSETS_DIR=assets -G "MinGW Makefiles" .. cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_ASSETS_DIR=assets -G "MinGW Makefiles" ..
mingw32-make -j2 mingw32-make -j2
- name: Create packages - name: Create packages
shell: msys2 {0} shell: msys2 {0}
run: | run: |
cd sunshine-windows-build cd sunshine-windows-build
cpack
cpack -G NSIS
cpack -G 7Z
mkdir -p ../artifacts mkdir -p ../artifacts
# Installers # Installers
mv Sunshine__.exe ../artifacts/sunshine-windows-installer.exe mv Sunshine__.exe ../artifacts/sunshine-windows-installer.exe
mv Sunshine__.7z ../artifacts/sunshine-windows-standalone.7z
# Standalone
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
move "sunshine-windows.zip" "../artifacts"
- name: Upload Sunshine Installer - name: Upload Sunshine Installer
if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: sunshine-windows name: sunshine-windows
path: artifacts path: artifacts
- name: Upload Sunshine executable
if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} release:
uses: actions/upload-artifact@v3 name: Create Release
with: runs-on: ubuntu-20.04
name: sunshine-windows-standalone needs: [ "build_win", "build_linux", "build_appimage" ]
path: sunshine-windows-build/artifacts/standalone steps:
- name: Create Release - name: Create Release
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
uses: SunshineStream/actions/create_release@master uses: SunshineStream/actions/create_release@master