Skip to content

Commit

Permalink
Merge pull request #954 from LizardByte/nightly
Browse files Browse the repository at this point in the history
v0.18.4
  • Loading branch information
ReenigneArcher authored Feb 21, 2023
2 parents 9563419 + e113ac6 commit 0dfbcfd
Show file tree
Hide file tree
Showing 15 changed files with 102 additions and 385 deletions.
49 changes: 39 additions & 10 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ body:
- macOS
- Windows
- other, n/a
validations:
required: true
- type: input
id: os-version
attributes:
Expand All @@ -73,11 +75,13 @@ body:
- 64 bit
- arm
- other, n/a
validations:
required: true
- type: input
id: version
attributes:
label: Sunshine commit or version
placeholder: eg. 0.16.0
placeholder: eg. 0.18.0
validations:
required: true
- type: dropdown
Expand All @@ -87,20 +91,28 @@ body:
description: The package you installed
options:
- Linux - AppImage
- Linux - AUR
- Linux - 20.04-deb
- Linux - 22.04-deb
- Linux - AUR (Third Party)
- Linux - deb
- Linux - Docker
- Linux - flatpak
- Linux - nixpkgs (Third Party)
- Linux - PKGBUILD
- Linux - pkg.tar.zst
- Linux - rpm
- Linux - solus (Third Party)
- macOS - dmg
- macOS - Portfile
- macOS - pkg
- Windows - Chocolatey (Third Party)
- Windows - installer
- Windows - portable
- Windows - Scoop (Third Party)
- Windows - Winget (Third Party)
- other (not listed)
- other (self built)
- other (fork of this repo)
validations:
required: true
- type: dropdown
id: graphics_type
attributes:
Expand All @@ -111,6 +123,8 @@ body:
- Intel
- Nvidia
- none (software encoding)
validations:
required: true
- type: input
id: graphics_model
attributes:
Expand All @@ -135,16 +149,31 @@ body:
placeholder: e.g. PipeWire/KVM/X11/KMS
validations:
required: false
- type: textarea
id: config
attributes:
label: Config
description: |
Please copy and paste your config (`sunshine.conf`) file.
render: Shell
validations:
required: true
- type: textarea
id: apps
attributes:
label: Apps
description: |
If this is an issue with launching a game or app, please copy and paste your `apps.json` file.
render: json
validations:
required: false
- type: textarea
id: logs
attributes:
label: Relevant log output
description: |
Please copy and paste any relevant log output. This will be automatically formatted into code,
so no need for backticks.
render: Shell
- type: markdown
attributes:
value: |
Make sure to close your issue when it's solved! If you found the solution yourself please comment
so that others benefit from it.
render: shell
validations:
required: true
6 changes: 3 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ jobs:
- name: Setup Dependencies MacOS
run: |
# install dependencies using homebrew
brew install boost cmake curl node opus
brew install boost cmake curl node opus pkg-config
# fix openssl header not found
ln -sf /usr/local/opt/openssl/include/openssl /usr/local/include/openssl
Expand Down Expand Up @@ -813,8 +813,8 @@ jobs:
cpack -G ZIP
# move
mv ./cpack_artifacts/Sunshine.exe ../artifacts/sunshine-windows.exe
mv ./cpack_artifacts/Sunshine.zip ../artifacts/sunshine-windows.zip
mv ./cpack_artifacts/Sunshine.exe ../artifacts/sunshine-windows-installer.exe
mv ./cpack_artifacts/Sunshine.zip ../artifacts/sunshine-windows-portable.zip
- name: Upload Artifacts
uses: actions/upload-artifact@v3
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/ci-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,10 @@ jobs:
elif [[ $line == "# artifacts: "* && $ARTIFACTS == "" ]]; then
# echo the line and use `sed` to remove the custom directive
ARTIFACTS=$(echo -e "$line" | sed 's/# artifacts: //')
elif [[ $PLATFORMS != "" && $ARTIFACTS != "" ]]; then
elif [[ $line == "# no-cache-filters: "* && $NO_CACHE_FILTERS == "" ]]; then
# echo the line and use `sed` to remove the custom directive
NO_CACHE_FILTERS=$(echo -e "$line" | sed 's/# no-cache-filters: //')
elif [[ $PLATFORMS != "" && $ARTIFACTS != "" && $NO_CACHE_FILTERS != "" ]]; then
# break while loop once all custom directives are found
break
fi
Expand All @@ -290,6 +293,7 @@ jobs:
echo "clone_url=${CLONE_URL}" >> $GITHUB_OUTPUT
echo "release=${RELEASE}" >> $GITHUB_OUTPUT
echo "artifacts=${ARTIFACTS}" >> $GITHUB_OUTPUT
echo "no_cache_filters=${NO_CACHE_FILTERS}" >> $GITHUB_OUTPUT
echo "platforms=${PLATFORMS}" >> $GITHUB_OUTPUT
echo "push=${PUSH}" >> $GITHUB_OUTPUT
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -345,6 +349,7 @@ jobs:
tags: ${{ steps.prepare.outputs.tags }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
no-cache-filters: ${{ steps.prepare.outputs.no_cache_filters }}

- name: Build and push
id: build
Expand All @@ -361,13 +366,10 @@ jobs:
COMMIT=${{ steps.prepare.outputs.commit }}
CLONE_URL=${{ steps.prepare.outputs.clone_url }}
RELEASE=${{ steps.prepare.outputs.release }}
secrets: |
"AUR_EMAIL=${{ secrets.AUR_EMAIL }}"
"AUR_SSH_PRIVATE_KEY=${{ secrets.AUR_SSH_PRIVATE_KEY }}"
"AUR_USERNAME=${{ secrets.AUR_USERNAME }}"
tags: ${{ steps.prepare.outputs.tags }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
no-cache-filters: ${{ steps.prepare.outputs.no_cache_filters }}

- name: Arrange Artifacts
if: ${{ steps.prepare.outputs.artifacts == 'true' }}
Expand All @@ -378,6 +380,9 @@ jobs:
# https://unix.stackexchange.com/a/52816
find ./ -type f -exec mv -t ./ -n '{}' +
# remove provenance file
rm -f ./provenance.json
- name: Upload Artifacts
if: ${{ steps.prepare.outputs.artifacts == 'true' }}
uses: actions/upload-artifact@v3
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## [0.18.4] - 2023-02-20
### Fixed
- (Linux/AUR) Drop support of AUR package
- (Docker) General enhancements to docker images

## [0.18.3] - 2023-02-13
### Added
- (Linux) Added PKGBUILD for Archlinux based distros to releases
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.18)
# `CMAKE_CUDA_ARCHITECTURES` requires 3.18

project(Sunshine VERSION 0.18.3
project(Sunshine VERSION 0.18.4
DESCRIPTION "Sunshine is a self-hosted game stream host for Moonlight."
HOMEPAGE_URL "https://app.lizardbyte.dev")

Expand Down
4 changes: 0 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,6 @@ Stats
:alt: GitHub stars
:target: https://github.com/LizardByte/Sunshine

.. image:: https://img.shields.io/badge/dynamic/json?color=blue&label=AUR&style=for-the-badge&query=$.results.0.NumVotes&url=https%3A%2F%2Fapp.lizardbyte.dev%2Funo%2Faur%2Fsunshine.json&logo=archlinux
:alt: AUR votes
:target: https://aur.archlinux.org/packages/sunshine

.. _nvenc support matrix: https://developer.nvidia.com/video-encode-and-decode-gpu-support-matrix-new
.. _obs-amd hardware support: https://github.com/obsproject/obs-amd-encoder/wiki/Hardware-Support
.. _VAAPI hardware support: https://www.intel.com/content/www/us/en/developer/articles/technical/linuxmedia-vaapi.html
122 changes: 13 additions & 109 deletions docker/archlinux.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# artifacts: true
# platforms: linux/amd64
# archlinux does not have an arm64 base image
# no-cache-filters: sunshine-base,artifacts,sunshine
ARG BASE=archlinux
ARG TAG=base-devel
FROM ${BASE}:${TAG} AS sunshine-base
Expand All @@ -11,31 +12,13 @@ RUN <<_DEPS
#!/bin/bash
set -e
pacman -Syu --noconfirm \
archlinux-keyring \
git
archlinux-keyring
_DEPS

# Setup builder user, arch prevents running makepkg as root
RUN useradd -m builder && \
echo 'builder ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
WORKDIR /home/builder
USER builder

# install paru
WORKDIR /tmp
RUN git clone https://aur.archlinux.org/paru.git
WORKDIR /tmp/paru
RUN makepkg -si --noconfirm

# install optional dependencies
RUN paru -Syu --noconfirm \
cuda \
libcap \
libdrm

# switch back to root user, hadolint will complain if last user is root
# hadolint ignore=DL3002
USER root
# makepkg is used in sunshine-build and uploader build stages

FROM sunshine-base as sunshine-build

Expand All @@ -46,12 +29,16 @@ ARG CLONE_URL

SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# install dependencies
# cuda, libcap, and libdrm are optional dependencies for PKGBUILD
RUN <<_DEPS
#!/bin/bash
set -e
pacman -Syu --noconfirm \
base-devel \
cmake \
cuda \
libcap \
libdrm \
namcap
_DEPS

Expand All @@ -60,7 +47,7 @@ USER builder

# copy repository
WORKDIR /build/sunshine/
COPY .. .
COPY --link .. .

# setup build directory
WORKDIR /build/sunshine/build
Expand Down Expand Up @@ -97,96 +84,13 @@ _PKGBUILD

FROM scratch as artifacts

COPY --from=sunshine-build /build/sunshine/pkg/PKGBUILD /PKGBUILD
COPY --from=sunshine-build /build/sunshine/pkg/sunshine*.pkg.tar.zst /sunshine.pkg.tar.zst

FROM sunshine-base as uploader

# most of this stage is borrowed from
# https://github.com/KSXGitHub/github-actions-deploy-aur/blob/master/build.sh

ARG BUILD_VERSION
ARG RELEASE
ARG TARGETPLATFORM

# Setup builder user
WORKDIR /home/builder
USER builder

# hadolint ignore=SC3010
RUN <<_SSH_CONFIG
#!/bin/bash
set -e
if [[ "${TARGETPLATFORM}" == 'linux/amd64' ]]; then
echo "Host aur.archlinux.org"; echo " IdentityFile ~/.ssh/aur"; echo " User aur" >>~/.ssh/config
fi
_SSH_CONFIG

# create and apply secrets, hadolint is giving a false positive
# hadolint ignore=SC1133
RUN --mount=type=secret,id=AUR_EMAIL,target=/secrets/AUR_EMAIL \
--mount=type=secret,id=AUR_SSH_PRIVATE_KEY,target=/secrets/AUR_SSH_PRIVATE_KEY \
--mount=type=secret,id=AUR_USERNAME,target=/secrets/AUR_USERNAME && \
cat /secrets/AUR_SSH_PRIVATE_KEY >~/.ssh/aur && \
git config --global user.name "$(cat /secrets/AUR_USERNAME)" && \
git config --global user.email "$(cat /secrets/AUR_EMAIL)"

WORKDIR /tmp

# hadolint ignore=SC3010
RUN <<_AUR_SETUP
#!/bin/bash
set -e

if [[ "${TARGETPLATFORM}" == 'linux/amd64' ]]; then
# Adding aur.archlinux.org to known hosts
ssh_keyscan_types="rsa,dsa,ecdsa,ed25519"
ssh-keyscan -v -t "$ssh_keyscan_types" aur.archlinux.org >>~/.ssh/known_hosts

# Importing private key
chmod -vR 600 ~/.ssh/aur*
ssh-keygen -vy -f ~/.ssh/aur >~/.ssh/aur.pub

# Clone AUR package
mkdir -p /tmp/local-repo
git clone -v "https://aur.archlinux.org/sunshine.git" /tmp/local-repo

# Copy built package
COPY --from=artifacts /PRKBUILD /tmp/local-repo/
fi
_AUR_SETUP

WORKDIR /tmp/local-repo
# aur upload if release event
# hadolint ignore=SC3010
RUN <<_AUR_UPLOAD
#!/bin/bash
set -e
if [[ "${RELEASE}" == "true" && "${TARGETPLATFORM}" == 'linux/amd64' ]]; then
# update package checksums
updpkgsums

# generate srcinfo
makepkg --printsrcinfo >.SRCINFO

# commit changes
git add --all

# check if there are any changes and commit/push
if [[ $(git diff-index --quiet HEAD) != "" ]]; then
git commit -m "${BUILD_VERSION}"
git remote add aur "https://aur.archlinux.org/sunshine.git"
git push -v aur master
fi
fi
_AUR_UPLOAD

# remove secrets
RUN rm -rf /secrets
COPY --link --from=sunshine-build /build/sunshine/pkg/PKGBUILD /PKGBUILD
COPY --link --from=sunshine-build /build/sunshine/pkg/sunshine*.pkg.tar.zst /sunshine.pkg.tar.zst

FROM sunshine-base as sunshine

COPY --from=artifacts /sunshine*.pkg.tar.zst /sunshine.pkg.tar.zst
# copy from uploader instead of artifacts or uploader stage will not run
COPY --link --from=artifacts /sunshine.pkg.tar.zst /

# install sunshine
RUN <<_INSTALL_SUNSHINE
Expand Down Expand Up @@ -216,7 +120,7 @@ ENV HOME=/home/$UNAME
RUN <<_SETUP_USER
#!/bin/bash
set -e
# first delete the builder
# first delete the builder user
userdel -r builder

# then create the lizard user
Expand Down
Loading

0 comments on commit 0dfbcfd

Please sign in to comment.