mirror of
https://github.com/LizardByte/Sunshine.git
synced 2025-08-10 00:52:16 +00:00
Compare commits
116 Commits
ci/homebre
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
33795485a0 | ||
|
|
4503fea7fb | ||
|
|
03bb53d591 | ||
|
|
bb6e3bc8e1 | ||
|
|
b2d3ded6f4 | ||
|
|
9f101fb546 | ||
|
|
48c2c52498 | ||
|
|
d6787c4ed4 | ||
|
|
eff88de993 | ||
|
|
b3ee60d422 | ||
|
|
99cf9ac960 | ||
|
|
4bac84ee38 | ||
|
|
7252d9e897 | ||
|
|
8bfb65ee4b | ||
|
|
f2e4f55a84 | ||
|
|
84bb4cfaf1 | ||
|
|
bce4b1b4c5 | ||
|
|
a19312bbf1 | ||
|
|
274b998ec5 | ||
|
|
31f87bbc18 | ||
|
|
2b785b3cb9 | ||
|
|
6ab24491ed | ||
|
|
77edcd047f | ||
|
|
d4fe41556c | ||
|
|
cb54e5e90a | ||
|
|
5097afdea9 | ||
|
|
1d4f5c3798 | ||
|
|
1725da216b | ||
|
|
99a757627c | ||
|
|
047cc684cf | ||
|
|
dfeeebfacf | ||
|
|
fe26129697 | ||
|
|
4478fd2a14 | ||
|
|
35f0b30845 | ||
|
|
aa7b83bdfc | ||
|
|
165e5e9b81 | ||
|
|
3cfe4e2ec5 | ||
|
|
feac80656d | ||
|
|
417007685d | ||
|
|
01f281a4a3 | ||
|
|
d96251d18f | ||
|
|
914c423338 | ||
|
|
512aa1e2aa | ||
|
|
1bc491f949 | ||
|
|
d28e221bb7 | ||
|
|
c0823c7444 | ||
|
|
2a9bb98c6e | ||
|
|
7e95d536a9 | ||
|
|
2259141bd2 | ||
|
|
5ef3f2ff5c | ||
|
|
9f399eef5c | ||
|
|
6f78404c18 | ||
|
|
5a40190830 | ||
|
|
d3ef63bd9b | ||
|
|
c0e029117d | ||
|
|
5b1da1c1ab | ||
|
|
65f14e1003 | ||
|
|
27f71c3895 | ||
|
|
2f27a57d01 | ||
|
|
738ac93a0e | ||
|
|
d6820ba019 | ||
|
|
4cdb5cd452 | ||
|
|
ced363833c | ||
|
|
f62299d018 | ||
|
|
6203e8118a | ||
|
|
63229ac28b | ||
|
|
543e239f83 | ||
|
|
373df9d7f7 | ||
|
|
684530af1f | ||
|
|
597bccef92 | ||
|
|
986aa176ee | ||
|
|
926cafa6a9 | ||
|
|
fb51c2c649 | ||
|
|
8e061c44c5 | ||
|
|
b48e6303ea | ||
|
|
958d783d94 | ||
|
|
6c2efced6d | ||
|
|
919f54495b | ||
|
|
64e6c48577 | ||
|
|
9db11a9061 | ||
|
|
1e082ab790 | ||
|
|
a212a542a0 | ||
|
|
7017b8e88c | ||
|
|
c9a06fd8a7 | ||
|
|
b2d44f5ba9 | ||
|
|
e7a8f3b3ce | ||
|
|
9248231510 | ||
|
|
0ad1b1234e | ||
|
|
8afb672bb8 | ||
|
|
7291fa5f12 | ||
|
|
878437362e | ||
|
|
1984d822be | ||
|
|
e40b7cb731 | ||
|
|
0a98094613 | ||
|
|
eaa434ab45 | ||
|
|
a80ec75465 | ||
|
|
1938385bf0 | ||
|
|
0de8cc864c | ||
|
|
a857c8b715 | ||
|
|
eeef57b168 | ||
|
|
356545fa7d | ||
|
|
883eff5d24 | ||
|
|
673e0fa4f4 | ||
|
|
3ad90cd7f1 | ||
|
|
ef5253a61d | ||
|
|
0bdc9188c3 | ||
|
|
ae1ee8fb45 | ||
|
|
5e049e3c61 | ||
|
|
9effeba5fe | ||
|
|
3092471be5 | ||
|
|
9c08c75a44 | ||
|
|
8ca976f2d0 | ||
|
|
2ca2ea435f | ||
|
|
7b873e9ea4 | ||
|
|
8f6cd37a62 | ||
|
|
1a5f5e59de |
@@ -1,11 +0,0 @@
|
||||
# install dependencies for C++ analysis
|
||||
set -e
|
||||
|
||||
chmod +x ./scripts/linux_build.sh
|
||||
./scripts/linux_build.sh --skip-package --ubuntu-test-repo
|
||||
|
||||
# Delete CUDA
|
||||
rm -rf ./build/cuda
|
||||
|
||||
# skip autobuild
|
||||
echo "skip_autobuild=true" >> "$GITHUB_OUTPUT"
|
||||
@@ -1,59 +0,0 @@
|
||||
# install dependencies for C++ analysis
|
||||
set -e
|
||||
|
||||
# update pacman
|
||||
pacman --noconfirm -Syu
|
||||
|
||||
gcc_version="14.2.0-3"
|
||||
|
||||
broken_deps=(
|
||||
"mingw-w64-ucrt-x86_64-gcc"
|
||||
"mingw-w64-ucrt-x86_64-gcc-libs"
|
||||
)
|
||||
|
||||
tarballs=""
|
||||
for dep in "${broken_deps[@]}"; do
|
||||
tarball="${dep}-${gcc_version}-any.pkg.tar.zst"
|
||||
|
||||
# download and install working version
|
||||
wget https://repo.msys2.org/mingw/ucrt64/${tarball}
|
||||
|
||||
tarballs="${tarballs} ${tarball}"
|
||||
done
|
||||
|
||||
# install broken dependencies
|
||||
if [ -n "$tarballs" ]; then
|
||||
pacman -U --noconfirm ${tarballs}
|
||||
fi
|
||||
|
||||
# install dependencies
|
||||
dependencies=(
|
||||
"git"
|
||||
"mingw-w64-ucrt-x86_64-cmake"
|
||||
"mingw-w64-ucrt-x86_64-cppwinrt"
|
||||
"mingw-w64-ucrt-x86_64-curl-winssl"
|
||||
"mingw-w64-ucrt-x86_64-MinHook"
|
||||
"mingw-w64-ucrt-x86_64-miniupnpc"
|
||||
"mingw-w64-ucrt-x86_64-nlohmann-json"
|
||||
"mingw-w64-ucrt-x86_64-nodejs"
|
||||
"mingw-w64-ucrt-x86_64-nsis"
|
||||
"mingw-w64-ucrt-x86_64-onevpl"
|
||||
"mingw-w64-ucrt-x86_64-openssl"
|
||||
"mingw-w64-ucrt-x86_64-opus"
|
||||
"mingw-w64-ucrt-x86_64-toolchain"
|
||||
)
|
||||
|
||||
pacman -Syu --noconfirm --ignore="$(IFS=,; echo "${broken_deps[*]}")" "${dependencies[@]}"
|
||||
|
||||
# build
|
||||
mkdir -p build
|
||||
cmake \
|
||||
-B build \
|
||||
-G Ninja \
|
||||
-S . \
|
||||
-DBUILD_DOCS=OFF \
|
||||
-DBUILD_WERROR=ON
|
||||
ninja -C build
|
||||
|
||||
# skip autobuild
|
||||
echo "skip_autobuild=true" >> "$GITHUB_OUTPUT"
|
||||
@@ -1,32 +0,0 @@
|
||||
# install dependencies for C++ analysis
|
||||
set -e
|
||||
|
||||
# setup homebrew for x86_64
|
||||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||
eval "$(/usr/local/bin/brew shellenv)"
|
||||
|
||||
# install dependencies
|
||||
dependencies=(
|
||||
"cmake"
|
||||
"miniupnpc"
|
||||
"ninja"
|
||||
"node"
|
||||
"openssl@3"
|
||||
"opus"
|
||||
"pkg-config"
|
||||
)
|
||||
brew install "${dependencies[@]}"
|
||||
|
||||
# build
|
||||
mkdir -p build
|
||||
cmake \
|
||||
-B build \
|
||||
-G Ninja \
|
||||
-S . \
|
||||
-DBOOST_USE_STATIC=OFF \
|
||||
-DBUILD_DOCS=OFF \
|
||||
-DBUILD_WERROR=ON
|
||||
ninja -C build
|
||||
|
||||
# skip autobuild
|
||||
echo "skip_autobuild=true" >> "$GITHUB_OUTPUT"
|
||||
1
.flake8
1
.flake8
@@ -3,4 +3,5 @@ filename =
|
||||
*.py
|
||||
max-line-length = 120
|
||||
extend-exclude =
|
||||
.venv/
|
||||
venv/
|
||||
|
||||
5
.gitattributes
vendored
5
.gitattributes
vendored
@@ -1,6 +1,5 @@
|
||||
# ensure dockerfiles are checked out with LF line endings
|
||||
# ensure Linux specific files are checked out with LF line endings
|
||||
Dockerfile text eol=lf
|
||||
*.dockerfile text eol=lf
|
||||
|
||||
# ensure flatpak lint json files are checked out with LF line endings
|
||||
*flatpak-lint-*.json text eol=lf
|
||||
*.sh text eol=lf
|
||||
|
||||
49
.github/label-actions.yml
vendored
49
.github/label-actions.yml
vendored
@@ -1,49 +0,0 @@
|
||||
---
|
||||
# This file is centrally managed in https://github.com/<organization>/.github/
|
||||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||
# the above-mentioned repo.
|
||||
|
||||
# Configuration for Label Actions - https://github.com/dessant/label-actions
|
||||
|
||||
added:
|
||||
comment: >
|
||||
This feature has been added and will be available in the next release.
|
||||
fixed:
|
||||
comment: >
|
||||
This issue has been fixed and will be available in the next release.
|
||||
invalid:duplicate:
|
||||
comment: >
|
||||
:wave: @{issue-author}, this appears to be a duplicate of a pre-existing issue.
|
||||
close: true
|
||||
lock: true
|
||||
unlabel: 'status:awaiting-triage'
|
||||
|
||||
-invalid:duplicate:
|
||||
reopen: true
|
||||
unlock: true
|
||||
|
||||
invalid:support:
|
||||
comment: >
|
||||
:wave: @{issue-author}, we use the issue tracker exclusively for bug reports.
|
||||
However, this issue appears to be a support request. Please use our
|
||||
[Support Center](https://app.lizardbyte.dev/support) for support issues. Thanks.
|
||||
close: true
|
||||
lock: true
|
||||
lock-reason: 'off-topic'
|
||||
unlabel: 'status:awaiting-triage'
|
||||
|
||||
-invalid:support:
|
||||
reopen: true
|
||||
unlock: true
|
||||
|
||||
invalid:template-incomplete:
|
||||
issues:
|
||||
comment: >
|
||||
:wave: @{issue-author}, please edit your issue to complete the template with
|
||||
all the required info. Your issue will be automatically closed in 5 days if
|
||||
the template is not completed. Thanks.
|
||||
prs:
|
||||
comment: >
|
||||
:wave: @{issue-author}, please edit your PR to complete the template with
|
||||
all the required info. Your PR will be automatically closed in 5 days if
|
||||
the template is not completed. Thanks.
|
||||
17
.github/matchers/copr-ci.json
vendored
Normal file
17
.github/matchers/copr-ci.json
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "copr-ci-gcc",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^/?(?:[^/]+/){5}([^:]+):(\\d+):(\\d+):\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"severity": 4,
|
||||
"message": 5
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
17
.github/matchers/docker.json
vendored
Normal file
17
.github/matchers/docker.json
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "docker-gcc",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^(?:#\\d+\\s+\\d+\\.\\d+\\s+)?/?(?:[^/]+/){2}([^:]+):(\\d+):(\\d+):\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"severity": 4,
|
||||
"message": 5
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
17
.github/matchers/gcc-strip3.json
vendored
Normal file
17
.github/matchers/gcc-strip3.json
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "gcc-strip3",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^/?(?:[^/]+/){3}([^:]+):(\\d+):(\\d+):\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"severity": 4,
|
||||
"message": 5
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
29
.github/matchers/gcc.json
vendored
Normal file
29
.github/matchers/gcc.json
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "gcc",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^(.*):(\\d+):(\\d+):\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"severity": 4,
|
||||
"message": 5
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"owner": "doxygen",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^.*?([A-Za-z]:[\\\\/][^:]+|[\\\\/][^:]+):(\\d+): ([a-zA-Z]+): (.+)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"severity": 3,
|
||||
"message": 4
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
1
.github/semantic.yml
vendored
1
.github/semantic.yml
vendored
@@ -12,3 +12,4 @@ titleAndCommits: false
|
||||
anyCommit: false
|
||||
allowMergeCommits: false
|
||||
allowRevertCommits: false
|
||||
targetUrl: https://docs.lizardbyte.dev/latest/developers/contributing.html#creating-a-pull-request
|
||||
|
||||
1069
.github/workflows/CI.yml
vendored
1069
.github/workflows/CI.yml
vendored
File diff suppressed because it is too large
Load Diff
30
.github/workflows/_codeql.yml
vendored
Normal file
30
.github/workflows/_codeql.yml
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
---
|
||||
# This workflow is centrally managed in https://github.com/LizardByte/.github/
|
||||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||
# the above-mentioned repo.
|
||||
|
||||
name: CodeQL
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
schedule:
|
||||
- cron: '00 12 * * 0' # every Sunday at 12:00 UTC
|
||||
|
||||
concurrency:
|
||||
group: "${{ github.workflow }}-${{ github.ref }}"
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
call-codeql:
|
||||
name: CodeQL
|
||||
uses: LizardByte/.github/.github/workflows/__call-codeql.yml@master
|
||||
if: ${{ github.repository != 'LizardByte/.github' }}
|
||||
27
.github/workflows/_common-lint.yml
vendored
Normal file
27
.github/workflows/_common-lint.yml
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
---
|
||||
# This workflow is centrally managed in https://github.com/LizardByte/.github/
|
||||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||
# the above-mentioned repo.
|
||||
|
||||
name: common lint
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
- reopened
|
||||
|
||||
concurrency:
|
||||
group: "${{ github.workflow }}-${{ github.ref }}"
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Common Lint
|
||||
uses: LizardByte/.github/.github/workflows/__call-common-lint.yml@master
|
||||
if: ${{ github.repository != 'LizardByte/.github' }}
|
||||
25
.github/workflows/_release-notifier.yml
vendored
Normal file
25
.github/workflows/_release-notifier.yml
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
# This workflow is centrally managed in https://github.com/LizardByte/.github/
|
||||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||
# the above-mentioned repo.
|
||||
|
||||
# Create a blog post for a new release and open a PR to the blog repo
|
||||
|
||||
name: Release Notifications
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- released # this triggers when a release is published, but does not include pre-releases or drafts
|
||||
|
||||
jobs:
|
||||
update-blog:
|
||||
name: Update blog
|
||||
uses: LizardByte/.github/.github/workflows/__call-release-notifier.yml@master
|
||||
if: github.repository_owner == 'LizardByte'
|
||||
secrets:
|
||||
GH_EMAIL: ${{ secrets.GH_BOT_EMAIL }}
|
||||
GH_NAME: ${{ secrets.GH_BOT_NAME }}
|
||||
GH_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
|
||||
@@ -1,10 +1,8 @@
|
||||
---
|
||||
# This workflow is centrally managed in https://github.com/<organization>/.github/
|
||||
# This workflow is centrally managed in https://github.com/LizardByte/.github/
|
||||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||
# the above-mentioned repo.
|
||||
|
||||
# Update changelog on release events.
|
||||
|
||||
name: Update changelog
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -24,14 +22,10 @@ concurrency:
|
||||
jobs:
|
||||
update-changelog:
|
||||
name: Update Changelog
|
||||
uses: LizardByte/.github/.github/workflows/__call-update-changelog.yml@master
|
||||
if: >-
|
||||
github.event_name == 'workflow_dispatch' ||
|
||||
(!github.event.release.prerelease && !github.event.release.draft)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Update Changelog
|
||||
uses: LizardByte/update-changelog-action@v2024.919.152649
|
||||
with:
|
||||
changelogBranch: changelog
|
||||
changelogFile: CHANGELOG.md
|
||||
token: ${{ secrets.GH_BOT_TOKEN }}
|
||||
github.repository_owner == 'LizardByte' &&
|
||||
(github.event_name == 'workflow_dispatch' ||
|
||||
(!github.event.release.prerelease && !github.event.release.draft))
|
||||
secrets:
|
||||
GH_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
|
||||
34
.github/workflows/_update-docs.yml
vendored
Normal file
34
.github/workflows/_update-docs.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
# This workflow is centrally managed in https://github.com/LizardByte/.github/
|
||||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||
# the above-mentioned repo.
|
||||
|
||||
# To use, add the `rtd` repository label to identify repositories that should trigger this workflow.
|
||||
# If the project slug is not the repository name, add a repository variable named `READTHEDOCS_SLUG` with the value of
|
||||
# the ReadTheDocs project slug.
|
||||
|
||||
# Update readthedocs on release events.
|
||||
|
||||
name: Update docs
|
||||
permissions: {}
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- created
|
||||
- edited
|
||||
- deleted
|
||||
|
||||
concurrency:
|
||||
group: "${{ github.workflow }}-${{ github.event.release.tag_name }}"
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
update-docs:
|
||||
name: Update docs
|
||||
uses: LizardByte/.github/.github/workflows/__call-update-docs.yml@master
|
||||
if: github.repository_owner == 'LizardByte'
|
||||
with:
|
||||
readthedocs_slug: ${{ vars.READTHEDOCS_SLUG }}
|
||||
secrets:
|
||||
READTHEDOCS_TOKEN: ${{ secrets.READTHEDOCS_TOKEN }}
|
||||
31
.github/workflows/_update-flathub-repo.yml
vendored
Normal file
31
.github/workflows/_update-flathub-repo.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
# This workflow is centrally managed in https://github.com/LizardByte/.github/
|
||||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||
# the above-mentioned repo.
|
||||
|
||||
# To use, add the `flathub-pkg` repository label to identify repositories that should trigger this workflow.
|
||||
|
||||
# Update Flathub on release events.
|
||||
|
||||
name: Update Flathub repo
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- released
|
||||
|
||||
concurrency:
|
||||
group: "${{ github.workflow }}-${{ github.event.release.tag_name }}"
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
update-flathub-repo:
|
||||
name: Update Flathub Repo
|
||||
uses: LizardByte/.github/.github/workflows/__call-update-flathub-repo.yml@master
|
||||
if: github.repository_owner == 'LizardByte'
|
||||
secrets:
|
||||
GH_EMAIL: ${{ secrets.GH_BOT_EMAIL }}
|
||||
GH_NAME: ${{ secrets.GH_BOT_NAME }}
|
||||
GH_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
|
||||
31
.github/workflows/_update-homebrew-repo.yml
vendored
Normal file
31
.github/workflows/_update-homebrew-repo.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
# This workflow is centrally managed in https://github.com/LizardByte/.github/
|
||||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||
# the above-mentioned repo.
|
||||
|
||||
# To use, add the `homebrew-pkg` repository label to identify repositories that should trigger this workflow.
|
||||
|
||||
# Update Homebrew on release events.
|
||||
|
||||
name: Update Homebrew repo
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- released
|
||||
|
||||
concurrency:
|
||||
group: "${{ github.workflow }}-${{ github.event.release.tag_name }}"
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
update-homebrew-repo:
|
||||
name: Update Homebrew repo
|
||||
uses: LizardByte/.github/.github/workflows/__call-update-homebrew-repo.yml@master
|
||||
if: github.repository_owner == 'LizardByte'
|
||||
secrets:
|
||||
GH_EMAIL: ${{ secrets.GH_BOT_EMAIL }}
|
||||
GH_USERNAME: ${{ secrets.GH_BOT_NAME }}
|
||||
GH_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
|
||||
31
.github/workflows/_update-pacman-repo.yml
vendored
Normal file
31
.github/workflows/_update-pacman-repo.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
# This workflow is centrally managed in https://github.com/LizardByte/.github/
|
||||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||
# the above-mentioned repo.
|
||||
|
||||
# To use, add the `pacman-pkg` repository label to identify repositories that should trigger this workflow.
|
||||
|
||||
# Update pacman repo on release events.
|
||||
|
||||
name: Update pacman repo
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- released
|
||||
|
||||
concurrency:
|
||||
group: "${{ github.workflow }}-${{ github.event.release.tag_name }}"
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
update-homebrew-release:
|
||||
name: Update pacman repo
|
||||
uses: LizardByte/.github/.github/workflows/__call-update-pacman-repo.yml@master
|
||||
if: github.repository_owner == 'LizardByte'
|
||||
secrets:
|
||||
GH_EMAIL: ${{ secrets.GH_BOT_EMAIL }}
|
||||
GH_NAME: ${{ secrets.GH_BOT_NAME }}
|
||||
GH_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
|
||||
29
.github/workflows/_update-winget-repo.yml
vendored
Normal file
29
.github/workflows/_update-winget-repo.yml
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
# This workflow is centrally managed in https://github.com/LizardByte/.github/
|
||||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||
# the above-mentioned repo.
|
||||
|
||||
# To use, add the `winget-pkg` repository label to identify repositories that should trigger this workflow.
|
||||
|
||||
# Update Winget on release events.
|
||||
|
||||
name: Update Winget repo
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- released
|
||||
|
||||
concurrency:
|
||||
group: "${{ github.workflow }}-${{ github.event.release.tag_name }}"
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
update-winget-repo:
|
||||
name: Update Winget repo
|
||||
uses: LizardByte/.github/.github/workflows/__call-update-winget-repo.yml@master
|
||||
if: github.repository_owner == 'LizardByte'
|
||||
secrets:
|
||||
GH_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
|
||||
55
.github/workflows/ci-copr.yml
vendored
55
.github/workflows/ci-copr.yml
vendored
@@ -1,23 +1,28 @@
|
||||
---
|
||||
name: CI Copr
|
||||
name: CI-Copr
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
- reopened
|
||||
release:
|
||||
types:
|
||||
- prereleased
|
||||
- released
|
||||
workflow_call:
|
||||
secrets:
|
||||
COPR_BETA_WEBHOOK_TOKEN:
|
||||
required: false
|
||||
COPR_STABLE_WEBHOOK_TOKEN:
|
||||
required: false
|
||||
COPR_CLI_CONFIG:
|
||||
required: false
|
||||
GH_BOT_TOKEN:
|
||||
required: false
|
||||
VIRUSTOTAL_API_KEY:
|
||||
required: false
|
||||
|
||||
concurrency:
|
||||
group: "${{ github.workflow }}-${{ github.ref }}"
|
||||
group: "_${{ github.workflow }}-${{ github.ref }}"
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
@@ -33,3 +38,35 @@ jobs:
|
||||
COPR_BETA_WEBHOOK_TOKEN: ${{ secrets.COPR_BETA_WEBHOOK_TOKEN }}
|
||||
COPR_STABLE_WEBHOOK_TOKEN: ${{ secrets.COPR_STABLE_WEBHOOK_TOKEN }}
|
||||
COPR_CLI_CONFIG: ${{ secrets.COPR_CLI_CONFIG }}
|
||||
|
||||
release:
|
||||
name: Release
|
||||
if:
|
||||
github.event_name == 'release' &&
|
||||
startsWith(github.repository, 'LizardByte/')
|
||||
needs:
|
||||
- call-copr-ci
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Download build artifacts
|
||||
uses: actions/download-artifact@v5
|
||||
with:
|
||||
path: artifacts
|
||||
pattern: build-*
|
||||
merge-multiple: true
|
||||
|
||||
- name: Debug artifacts
|
||||
run: ls -l artifacts
|
||||
|
||||
- name: Update GitHub Release
|
||||
uses: LizardByte/actions/actions/release_create@v2025.715.25226
|
||||
with:
|
||||
allowUpdates: true
|
||||
body: ${{ github.event.release.body }}
|
||||
deleteOtherPreReleases: false
|
||||
generateReleaseNotes: false
|
||||
name: ${{ github.event.release.name }}
|
||||
prerelease: true
|
||||
tag: ${{ github.event.release.tag_name }}
|
||||
token: ${{ secrets.GH_BOT_TOKEN }}
|
||||
virustotal_api_key: ${{ secrets.VIRUSTOTAL_API_KEY }}
|
||||
|
||||
380
.github/workflows/ci-docker.yml
vendored
380
.github/workflows/ci-docker.yml
vendored
@@ -1,380 +0,0 @@
|
||||
---
|
||||
# This workflow is centrally managed in https://github.com/<organization>/.github/
|
||||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||
# the above-mentioned repo.
|
||||
|
||||
# This workflow is intended to work with all our organization Docker projects. A readme named `DOCKER_README.md`
|
||||
# will be used to update the description on Docker hub.
|
||||
|
||||
# custom comments in dockerfiles:
|
||||
|
||||
# `# platforms: `
|
||||
# Comma separated list of platforms, i.e. `# platforms: linux/386,linux/amd64`. Docker platforms can alternatively
|
||||
# be listed in a file named `.docker_platforms`.
|
||||
# `# platforms_pr: `
|
||||
# Comma separated list of platforms to run for PR events, i.e. `# platforms_pr: linux/amd64`. This will take
|
||||
# precedence over the `# platforms: ` directive.
|
||||
# `# artifacts: `
|
||||
# `true` to build in two steps, stopping at `artifacts` build stage and extracting the image from there to the
|
||||
# GitHub runner.
|
||||
|
||||
name: CI Docker
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
- reopened
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: "${{ github.workflow }}-${{ github.ref }}"
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
check_dockerfiles:
|
||||
name: Check Dockerfiles
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Find dockerfiles
|
||||
id: find
|
||||
run: |
|
||||
dockerfiles=$(find . -type f -iname "Dockerfile" -o -iname "*.dockerfile")
|
||||
|
||||
echo "found dockerfiles: ${dockerfiles}"
|
||||
|
||||
# do not quote to keep this as a single line
|
||||
echo dockerfiles=${dockerfiles} >> $GITHUB_OUTPUT
|
||||
|
||||
MATRIX_COMBINATIONS=""
|
||||
for FILE in ${dockerfiles}; do
|
||||
# extract tag from file name
|
||||
tag=$(echo $FILE | sed -r -z -e 's/(\.\/)*.*\/(Dockerfile)/None/gm')
|
||||
if [[ $tag == "None" ]]; then
|
||||
MATRIX_COMBINATIONS="$MATRIX_COMBINATIONS {\"dockerfile\": \"$FILE\"},"
|
||||
else
|
||||
tag=$(echo $FILE | sed -r -z -e 's/(\.\/)*.*\/(.+)(\.dockerfile)/-\2/gm')
|
||||
MATRIX_COMBINATIONS="$MATRIX_COMBINATIONS {\"dockerfile\": \"$FILE\", \"tag\": \"$tag\"},"
|
||||
fi
|
||||
done
|
||||
|
||||
# removes the last character (i.e. comma)
|
||||
MATRIX_COMBINATIONS=${MATRIX_COMBINATIONS::-1}
|
||||
|
||||
# setup matrix for later jobs
|
||||
matrix=$((
|
||||
echo "{ \"include\": [$MATRIX_COMBINATIONS] }"
|
||||
) | jq -c .)
|
||||
|
||||
echo $matrix
|
||||
echo $matrix | jq .
|
||||
echo "matrix=$matrix" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Find dotnet solution file
|
||||
id: find_dotnet
|
||||
run: |
|
||||
solution=$(find . -maxdepth 1 -type f -iname "*.sln")
|
||||
|
||||
echo "found solution: ${solution}"
|
||||
|
||||
# do not quote to keep this as a single line
|
||||
echo solution=${solution} >> $GITHUB_OUTPUT
|
||||
|
||||
if [[ $solution != "" ]]; then
|
||||
echo "dotnet=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "dotnet=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
outputs:
|
||||
dockerfiles: ${{ steps.find.outputs.dockerfiles }}
|
||||
matrix: ${{ steps.find.outputs.matrix }}
|
||||
dotnet: ${{ steps.find_dotnet.outputs.dotnet }}
|
||||
solution: ${{ steps.find_dotnet.outputs.solution }}
|
||||
|
||||
setup_release:
|
||||
name: Setup Release
|
||||
if: needs.check_dockerfiles.outputs.dockerfiles
|
||||
needs: check_dockerfiles
|
||||
outputs:
|
||||
publish_release: ${{ steps.setup_release.outputs.publish_release }}
|
||||
release_body: ${{ steps.setup_release.outputs.release_body }}
|
||||
release_commit: ${{ steps.setup_release.outputs.release_commit }}
|
||||
release_generate_release_notes: ${{ steps.setup_release.outputs.release_generate_release_notes }}
|
||||
release_tag: ${{ steps.setup_release.outputs.release_tag }}
|
||||
release_version: ${{ steps.setup_release.outputs.release_version }}
|
||||
permissions:
|
||||
contents: write # read does not work to check squash and merge details
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Release
|
||||
id: setup_release
|
||||
uses: LizardByte/setup-release-action@v2025.426.225
|
||||
with:
|
||||
dotnet: ${{ needs.check_dockerfiles.outputs.dotnet }}
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
docker:
|
||||
name: Docker${{ matrix.tag }}
|
||||
if: needs.check_dockerfiles.outputs.dockerfiles
|
||||
needs:
|
||||
- check_dockerfiles
|
||||
- setup_release
|
||||
permissions:
|
||||
packages: write
|
||||
contents: write
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{ fromJson(needs.check_dockerfiles.outputs.matrix) }}
|
||||
steps:
|
||||
- name: Maximize build space
|
||||
uses: easimon/maximize-build-space@v10
|
||||
with:
|
||||
root-reserve-mb: 30720 # https://github.com/easimon/maximize-build-space#caveats
|
||||
remove-dotnet: 'true'
|
||||
remove-android: 'true'
|
||||
remove-haskell: 'true'
|
||||
remove-codeql: 'true'
|
||||
remove-docker-images: 'true'
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Prepare
|
||||
id: prepare
|
||||
env:
|
||||
NV: ${{ needs.setup_release.outputs.release_tag }}
|
||||
run: |
|
||||
# get branch name
|
||||
BRANCH=${GITHUB_HEAD_REF}
|
||||
|
||||
RELEASE=${{ needs.setup_release.outputs.publish_release }}
|
||||
COMMIT=${{ needs.setup_release.outputs.release_commit }}
|
||||
|
||||
if [ -z "$BRANCH" ]; then
|
||||
echo "This is a PUSH event"
|
||||
BRANCH=${{ github.ref_name }}
|
||||
CLONE_URL=${{ github.event.repository.clone_url }}
|
||||
else
|
||||
echo "This is a PULL REQUEST event"
|
||||
CLONE_URL=${{ github.event.pull_request.head.repo.clone_url }}
|
||||
fi
|
||||
|
||||
# determine to push image to dockerhub and ghcr or not
|
||||
if [[ $GITHUB_EVENT_NAME == "push" ]]; then
|
||||
PUSH=true
|
||||
else
|
||||
PUSH=false
|
||||
fi
|
||||
|
||||
# setup the tags
|
||||
REPOSITORY=${{ github.repository }}
|
||||
BASE_TAG=$(echo $REPOSITORY | tr '[:upper:]' '[:lower:]')
|
||||
|
||||
TAGS="${BASE_TAG}:${COMMIT:0:7}${{ matrix.tag }},ghcr.io/${BASE_TAG}:${COMMIT:0:7}${{ matrix.tag }}"
|
||||
|
||||
if [[ $GITHUB_REF == refs/heads/master ]]; then
|
||||
TAGS="${TAGS},${BASE_TAG}:latest${{ matrix.tag }},ghcr.io/${BASE_TAG}:latest${{ matrix.tag }}"
|
||||
TAGS="${TAGS},${BASE_TAG}:master${{ matrix.tag }},ghcr.io/${BASE_TAG}:master${{ matrix.tag }}"
|
||||
else
|
||||
TAGS="${TAGS},${BASE_TAG}:test${{ matrix.tag }},ghcr.io/${BASE_TAG}:test${{ matrix.tag }}"
|
||||
fi
|
||||
|
||||
if [[ ${NV} != "" ]]; then
|
||||
TAGS="${TAGS},${BASE_TAG}:${NV}${{ matrix.tag }},ghcr.io/${BASE_TAG}:${NV}${{ matrix.tag }}"
|
||||
fi
|
||||
|
||||
# parse custom directives out of dockerfile
|
||||
# try to get the platforms from the dockerfile custom directive, i.e. `# platforms: xxx,yyy`
|
||||
# directives for PR event, i.e. not push event
|
||||
if [[ ${RELEASE} == "false" ]]; then
|
||||
while read -r line; do
|
||||
if [[ $line == "# platforms_pr: "* && $PLATFORMS == "" ]]; then
|
||||
# echo the line and use `sed` to remove the custom directive
|
||||
PLATFORMS=$(echo -e "$line" | sed 's/# platforms_pr: //')
|
||||
elif [[ $PLATFORMS != "" ]]; then
|
||||
# break while loop once all custom "PR" event directives are found
|
||||
break
|
||||
fi
|
||||
done <"${{ matrix.dockerfile }}"
|
||||
fi
|
||||
# directives for all events... above directives will not be parsed if they were already found
|
||||
while read -r line; do
|
||||
if [[ $line == "# platforms: "* && $PLATFORMS == "" ]]; then
|
||||
# echo the line and use `sed` to remove the custom directive
|
||||
PLATFORMS=$(echo -e "$line" | sed 's/# platforms: //')
|
||||
elif [[ $line == "# artifacts: "* && $ARTIFACTS == "" ]]; then
|
||||
# echo the line and use `sed` to remove the custom directive
|
||||
ARTIFACTS=$(echo -e "$line" | sed 's/# artifacts: //')
|
||||
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
|
||||
done <"${{ matrix.dockerfile }}"
|
||||
# if PLATFORMS is blank, fall back to the legacy method of reading from the `.docker_platforms` file
|
||||
if [[ $PLATFORMS == "" ]]; then
|
||||
# read the platforms from `.docker_platforms`
|
||||
PLATFORMS=$(<.docker_platforms)
|
||||
fi
|
||||
# if PLATFORMS is still blank, fall back to `linux/amd64`
|
||||
if [[ $PLATFORMS == "" ]]; then
|
||||
PLATFORMS="linux/amd64"
|
||||
fi
|
||||
|
||||
echo "branch=${BRANCH}" >> $GITHUB_OUTPUT
|
||||
echo "build_date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
|
||||
echo "clone_url=${CLONE_URL}" >> $GITHUB_OUTPUT
|
||||
echo "artifacts=${ARTIFACTS}" >> $GITHUB_OUTPUT
|
||||
echo "no_cache_filters=${NO_CACHE_FILTERS}" >> $GITHUB_OUTPUT
|
||||
echo "platforms=${PLATFORMS}" >> $GITHUB_OUTPUT
|
||||
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Set Up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
id: buildx
|
||||
|
||||
- name: Cache Docker Layers
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: /tmp/.buildx-cache
|
||||
key: Docker-buildx${{ matrix.tag }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
Docker-buildx${{ matrix.tag }}-
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
if: needs.setup_release.outputs.publish_release == 'true' # PRs do not have access to secrets
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
||||
|
||||
- name: Log in to the Container registry
|
||||
if: needs.setup_release.outputs.publish_release == 'true' # PRs do not have access to secrets
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ secrets.GH_BOT_NAME }}
|
||||
password: ${{ secrets.GH_BOT_TOKEN }}
|
||||
|
||||
- name: Build artifacts
|
||||
if: steps.prepare.outputs.artifacts == 'true'
|
||||
id: build_artifacts
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: ./
|
||||
file: ${{ matrix.dockerfile }}
|
||||
target: artifacts
|
||||
outputs: type=local,dest=artifacts
|
||||
push: false
|
||||
platforms: ${{ steps.prepare.outputs.platforms }}
|
||||
build-args: |
|
||||
BRANCH=${{ steps.prepare.outputs.branch }}
|
||||
BUILD_DATE=${{ steps.prepare.outputs.build_date }}
|
||||
BUILD_VERSION=${{ needs.setup_release.outputs.release_tag }}
|
||||
COMMIT=${{ needs.setup_release.outputs.release_commit }}
|
||||
CLONE_URL=${{ steps.prepare.outputs.clone_url }}
|
||||
RELEASE=${{ needs.setup_release.outputs.publish_release }}
|
||||
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
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: ./
|
||||
file: ${{ matrix.dockerfile }}
|
||||
push: ${{ needs.setup_release.outputs.publish_release }}
|
||||
platforms: ${{ steps.prepare.outputs.platforms }}
|
||||
build-args: |
|
||||
BRANCH=${{ steps.prepare.outputs.branch }}
|
||||
BUILD_DATE=${{ steps.prepare.outputs.build_date }}
|
||||
BUILD_VERSION=${{ needs.setup_release.outputs.release_tag }}
|
||||
COMMIT=${{ needs.setup_release.outputs.release_commit }}
|
||||
CLONE_URL=${{ steps.prepare.outputs.clone_url }}
|
||||
RELEASE=${{ needs.setup_release.outputs.publish_release }}
|
||||
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'
|
||||
working-directory: artifacts
|
||||
run: |
|
||||
# debug directory
|
||||
echo "Current directory: $(pwd)"
|
||||
echo "Directory contents: $(ls -Ra)"
|
||||
|
||||
# artifacts will be in sub directories named after the docker target platform, e.g. `linux_amd64`
|
||||
# so move files to the artifacts directory
|
||||
# https://unix.stackexchange.com/a/52816
|
||||
find \
|
||||
./ \
|
||||
-maxdepth 2 \
|
||||
-mindepth 2 \
|
||||
-type f \
|
||||
-not -name 'provenance.json' \
|
||||
-exec mv -t ./ -n '{}' +
|
||||
|
||||
# remove provenance file
|
||||
rm -f ./provenance.json
|
||||
|
||||
- name: Upload Artifacts
|
||||
if: steps.prepare.outputs.artifacts == 'true'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Docker${{ matrix.tag }}
|
||||
path: artifacts/
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Create/Update GitHub Release
|
||||
if: >
|
||||
needs.setup_release.outputs.publish_release == 'true' &&
|
||||
steps.prepare.outputs.artifacts == 'true'
|
||||
uses: LizardByte/create-release-action@v2025.426.1549
|
||||
with:
|
||||
allowUpdates: true
|
||||
artifacts: "*artifacts/*"
|
||||
body: ${{ needs.setup_release.outputs.release_body }}
|
||||
generateReleaseNotes: ${{ needs.setup_release.outputs.release_generate_release_notes }}
|
||||
name: ${{ needs.setup_release.outputs.release_tag }}
|
||||
prerelease: true
|
||||
tag: ${{ needs.setup_release.outputs.release_tag }}
|
||||
token: ${{ secrets.GH_BOT_TOKEN }}
|
||||
|
||||
- name: Update Docker Hub Description
|
||||
if: >
|
||||
github.event_name == 'push' &&
|
||||
github.ref == 'refs/heads/master'
|
||||
uses: peter-evans/dockerhub-description@v4
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_HUB_PASSWORD }} # token is not currently supported
|
||||
repository: ${{ env.BASE_TAG }}
|
||||
short-description: ${{ github.event.repository.description }}
|
||||
readme-filepath: ./DOCKER_README.md
|
||||
218
.github/workflows/ci-flatpak.yml
vendored
Normal file
218
.github/workflows/ci-flatpak.yml
vendored
Normal file
@@ -0,0 +1,218 @@
|
||||
---
|
||||
name: CI-Flatpak
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
release_commit:
|
||||
required: true
|
||||
type: string
|
||||
release_version:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
build_linux_flatpak:
|
||||
name: ${{ matrix.arch }}
|
||||
env:
|
||||
APP_ID: dev.lizardbyte.app.Sunshine
|
||||
NODE_VERSION: "20"
|
||||
PLATFORM_VERSION: "23.08"
|
||||
runs-on: ${{ matrix.runner }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- arch: x86_64
|
||||
runner: ubuntu-22.04
|
||||
- arch: aarch64
|
||||
runner: ubuntu-22.04-arm
|
||||
steps:
|
||||
- name: Maximize build space
|
||||
if: matrix.arch == 'x86_64'
|
||||
uses: easimon/maximize-build-space@v10
|
||||
with:
|
||||
root-reserve-mb: 10240
|
||||
remove-dotnet: 'true'
|
||||
remove-android: 'true'
|
||||
remove-haskell: 'true'
|
||||
remove-codeql: 'true'
|
||||
remove-docker-images: 'true'
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Setup node
|
||||
id: node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
|
||||
- name: Install npm dependencies
|
||||
run: npm install --package-lock-only
|
||||
|
||||
- name: Debug package-lock.json
|
||||
run: cat package-lock.json
|
||||
|
||||
- name: Setup python
|
||||
id: python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.12'
|
||||
|
||||
- name: Setup Dependencies Linux Flatpak
|
||||
run: |
|
||||
python -m pip install ./packaging/linux/flatpak/deps/flatpak-builder-tools/node
|
||||
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install -y \
|
||||
cmake \
|
||||
flatpak
|
||||
|
||||
sudo su "$(whoami)" -c "flatpak --user remote-add --if-not-exists flathub \
|
||||
https://flathub.org/repo/flathub.flatpakrepo
|
||||
"
|
||||
|
||||
sudo su "$(whoami)" -c "flatpak --user install -y flathub \
|
||||
org.flatpak.Builder \
|
||||
org.freedesktop.Platform/${{ matrix.arch }}/${PLATFORM_VERSION} \
|
||||
org.freedesktop.Sdk/${{ matrix.arch }}/${PLATFORM_VERSION} \
|
||||
org.freedesktop.Sdk.Extension.node${NODE_VERSION}/${{ matrix.arch }}/${PLATFORM_VERSION} \
|
||||
"
|
||||
|
||||
flatpak run org.flatpak.Builder --version
|
||||
|
||||
- name: flatpak node generator
|
||||
# https://github.com/flatpak/flatpak-builder-tools/blob/master/node/README.md
|
||||
run: flatpak-node-generator npm package-lock.json
|
||||
|
||||
- name: Debug generated-sources.json
|
||||
run: cat generated-sources.json
|
||||
|
||||
- name: Cache Flatpak build
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ./build/.flatpak-builder
|
||||
key: flatpak-${{ matrix.arch }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
flatpak-${{ matrix.arch }}-
|
||||
|
||||
- name: Configure Flatpak Manifest
|
||||
env:
|
||||
BRANCH: ${{ github.head_ref }}
|
||||
run: |
|
||||
# variables for manifest
|
||||
branch="${{ env.BRANCH }}"
|
||||
build_version=${{ inputs.release_version }}
|
||||
commit=${{ inputs.release_commit }}
|
||||
|
||||
# check the branch variable
|
||||
if [ -z "$branch" ]
|
||||
then
|
||||
echo "This is a PUSH event"
|
||||
branch=${{ github.ref_name }}
|
||||
clone_url=${{ github.event.repository.clone_url }}
|
||||
else
|
||||
echo "This is a PR event"
|
||||
clone_url=${{ github.event.pull_request.head.repo.clone_url }}
|
||||
fi
|
||||
echo "Branch: ${branch}"
|
||||
echo "Commit: ${commit}"
|
||||
echo "Clone URL: ${clone_url}"
|
||||
|
||||
export BRANCH=${branch}
|
||||
export BUILD_VERSION=${build_version}
|
||||
export CLONE_URL=${clone_url}
|
||||
export COMMIT=${commit}
|
||||
|
||||
mkdir -p build
|
||||
mkdir -p artifacts
|
||||
|
||||
cmake -DGITHUB_CLONE_URL=${clone_url} \
|
||||
-B build \
|
||||
-S . \
|
||||
-DSUNSHINE_CONFIGURE_FLATPAK_MAN=ON \
|
||||
-DSUNSHINE_CONFIGURE_ONLY=ON
|
||||
|
||||
- name: Debug Manifest
|
||||
working-directory: build
|
||||
run: cat "${APP_ID}.yml"
|
||||
|
||||
- name: Build Linux Flatpak
|
||||
working-directory: build
|
||||
run: |
|
||||
echo "::add-matcher::.github/matchers/gcc-strip3.json"
|
||||
sudo su "$(whoami)" -c "flatpak run org.flatpak.Builder \
|
||||
--arch=${{ matrix.arch }} \
|
||||
--force-clean \
|
||||
--repo=repo \
|
||||
--sandbox \
|
||||
--stop-at=cuda build-sunshine ${APP_ID}.yml"
|
||||
cp -r .flatpak-builder copy-of-flatpak-builder
|
||||
sudo su "$(whoami)" -c "flatpak run org.flatpak.Builder \
|
||||
--arch=${{ matrix.arch }} \
|
||||
--force-clean \
|
||||
--repo=repo \
|
||||
--sandbox \
|
||||
build-sunshine ${APP_ID}.yml"
|
||||
rm -rf .flatpak-builder
|
||||
mv copy-of-flatpak-builder .flatpak-builder
|
||||
sudo su "$(whoami)" -c "flatpak build-bundle \
|
||||
--arch=${{ matrix.arch }} \
|
||||
./repo \
|
||||
../artifacts/sunshine_${{ matrix.arch }}.flatpak ${APP_ID}"
|
||||
sudo su "$(whoami)" -c "flatpak build-bundle \
|
||||
--runtime \
|
||||
--arch=${{ matrix.arch }} \
|
||||
./repo \
|
||||
../artifacts/sunshine_debug_${{ matrix.arch }}.flatpak ${APP_ID}.Debug"
|
||||
echo "::remove-matcher owner=gcc-strip3::"
|
||||
|
||||
- name: Lint Flatpak
|
||||
working-directory: build
|
||||
run: |
|
||||
exceptions_file="${{ github.workspace }}/packaging/linux/flatpak/exceptions.json"
|
||||
|
||||
echo "Linting flatpak manifest"
|
||||
flatpak run --command=flatpak-builder-lint org.flatpak.Builder \
|
||||
--exceptions \
|
||||
--user-exceptions "${exceptions_file}" \
|
||||
manifest \
|
||||
"${APP_ID}.yml"
|
||||
|
||||
echo "Linting flatpak repo"
|
||||
# TODO: add arg
|
||||
# --mirror-screenshots-url=https://dl.flathub.org/media \
|
||||
flatpak run --command=flatpak-builder-lint org.flatpak.Builder \
|
||||
--exceptions \
|
||||
--user-exceptions "${exceptions_file}" \
|
||||
repo \
|
||||
repo
|
||||
|
||||
- name: Package Flathub repo archive
|
||||
# copy files required to generate the Flathub repo
|
||||
if: matrix.arch == 'x86_64'
|
||||
run: |
|
||||
mkdir -p flathub/modules
|
||||
cp "./build/generated-sources.json" "./flathub/"
|
||||
cp "./build/package-lock.json" "./flathub/"
|
||||
cp "./build/${APP_ID}.yml" "./flathub/"
|
||||
cp "./build/${APP_ID}.metainfo.xml" "./flathub/"
|
||||
cp "./packaging/linux/flatpak/README.md" "./flathub/"
|
||||
cp "./packaging/linux/flatpak/flathub.json" "./flathub/"
|
||||
cp -r "./packaging/linux/flatpak/modules/." "./flathub/modules/"
|
||||
# submodules will need to be handled in the workflow that creates the PR
|
||||
|
||||
# create the archive
|
||||
tar -czf ./artifacts/flathub.tar.gz -C ./flathub .
|
||||
|
||||
- name: Upload Artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: build-Linux-Flatpak-${{ matrix.arch }}
|
||||
path: artifacts/
|
||||
if-no-files-found: error
|
||||
236
.github/workflows/ci-homebrew.yml
vendored
Normal file
236
.github/workflows/ci-homebrew.yml
vendored
Normal file
@@ -0,0 +1,236 @@
|
||||
---
|
||||
name: CI-Homebrew
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
publish_release:
|
||||
required: true
|
||||
type: string
|
||||
release_commit:
|
||||
required: true
|
||||
type: string
|
||||
release_tag:
|
||||
required: true
|
||||
type: string
|
||||
release_version:
|
||||
required: true
|
||||
type: string
|
||||
secrets:
|
||||
GH_TOKEN:
|
||||
required: true
|
||||
GIT_EMAIL:
|
||||
required: true
|
||||
GIT_USERNAME:
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
build_homebrew:
|
||||
name: ${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}
|
||||
runs-on: ${{ matrix.os_name }}-${{ matrix.os_version }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
|
||||
# while GitHub has larger macOS runners, they are not available for our repos :(
|
||||
- os_version: "13"
|
||||
os_name: "macos"
|
||||
- os_version: "14"
|
||||
os_name: "macos"
|
||||
- os_version: "15"
|
||||
os_name: "macos"
|
||||
- os_version: "latest"
|
||||
os_name: "ubuntu"
|
||||
- os_version: "latest" # this job will only configure the formula for release, no validation
|
||||
os_name: "ubuntu"
|
||||
release: true
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Fix homebrew python
|
||||
if: matrix.os_name == 'macos' && matrix.os_version == '13'
|
||||
run: |
|
||||
rm '/usr/local/bin/2to3'
|
||||
rm '/usr/local/bin/2to3-3.12'
|
||||
rm '/usr/local/bin/idle3'
|
||||
rm '/usr/local/bin/idle3.12'
|
||||
rm '/usr/local/bin/idle3.13'
|
||||
rm '/usr/local/bin/pip3.12'
|
||||
rm '/usr/local/bin/pip3.13'
|
||||
rm '/usr/local/bin/pydoc3'
|
||||
rm '/usr/local/bin/pydoc3.12'
|
||||
rm '/usr/local/bin/pydoc3.13'
|
||||
rm '/usr/local/bin/python3'
|
||||
rm '/usr/local/bin/python3.12'
|
||||
rm '/usr/local/bin/python3.13'
|
||||
rm '/usr/local/bin/python3-config'
|
||||
rm '/usr/local/bin/python3.12-config'
|
||||
rm '/usr/local/bin/python3.13-config'
|
||||
brew install python3
|
||||
|
||||
- name: Configure formula
|
||||
env:
|
||||
HEAD_REF: ${{ github.head_ref }}
|
||||
PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
|
||||
PR_DEFAULT_BRANCH: ${{ github.event.pull_request.head.repo.default_branch }}
|
||||
run: |
|
||||
# variables for formula
|
||||
branch="${{ env.HEAD_REF }}"
|
||||
build_version=${{ inputs.release_version }}
|
||||
commit=${{ inputs.release_commit }}
|
||||
|
||||
# check the branch variable
|
||||
if [ -z "$branch" ]
|
||||
then
|
||||
echo "This is a PUSH event"
|
||||
clone_url=${{ github.event.repository.clone_url }}
|
||||
branch="${{ github.ref_name }}"
|
||||
default_branch="${{ github.event.repository.default_branch }}"
|
||||
|
||||
if [ "${{ matrix.release }}" == "true" ]; then
|
||||
# we will publish the formula with the release tag
|
||||
tag="${{ inputs.release_tag }}"
|
||||
else
|
||||
tag="${{ github.ref_name }}"
|
||||
fi
|
||||
else
|
||||
echo "This is a PR event"
|
||||
clone_url=${{ github.event.pull_request.head.repo.clone_url }}
|
||||
branch="${{ env.PR_HEAD_REF }}"
|
||||
default_branch="${{ env.PR_DEFAULT_BRANCH }}"
|
||||
tag="${{ env.PR_HEAD_REF }}"
|
||||
fi
|
||||
echo "Branch: ${branch}"
|
||||
echo "Clone URL: ${clone_url}"
|
||||
echo "Tag: ${tag}"
|
||||
|
||||
export BRANCH=${branch}
|
||||
export BUILD_VERSION=${build_version}
|
||||
export CLONE_URL=${clone_url}
|
||||
export COMMIT=${commit}
|
||||
export TAG=${tag}
|
||||
|
||||
mkdir -p build
|
||||
cmake \
|
||||
-B build \
|
||||
-S . \
|
||||
-DGITHUB_DEFAULT_BRANCH="${default_branch}" \
|
||||
-DSUNSHINE_CONFIGURE_HOMEBREW=ON \
|
||||
-DSUNSHINE_CONFIGURE_ONLY=ON
|
||||
|
||||
# copy formula to artifacts
|
||||
mkdir -p homebrew
|
||||
cp -f ./build/sunshine.rb ./homebrew/sunshine.rb
|
||||
|
||||
# testing
|
||||
cat ./homebrew/sunshine.rb
|
||||
|
||||
- name: Upload Artifacts
|
||||
if: matrix.release
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: build-Homebrew
|
||||
path: homebrew/
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Setup Xvfb
|
||||
if: matrix.release != true && runner.os == 'Linux'
|
||||
run: |
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install -y \
|
||||
xvfb
|
||||
|
||||
export DISPLAY=:1
|
||||
Xvfb ${DISPLAY} -screen 0 1024x768x24 &
|
||||
|
||||
echo "DISPLAY=${DISPLAY}" >> "${GITHUB_ENV}"
|
||||
|
||||
- run: echo "::add-matcher::.github/matchers/gcc-strip3.json"
|
||||
- name: Validate Homebrew Formula
|
||||
id: test
|
||||
if: matrix.release != true
|
||||
uses: LizardByte/actions/actions/release_homebrew@v2025.715.25226
|
||||
with:
|
||||
formula_file: ${{ github.workspace }}/homebrew/sunshine.rb
|
||||
git_email: ${{ secrets.GIT_EMAIL }}
|
||||
git_username: ${{ secrets.GIT_USERNAME }}
|
||||
publish: false
|
||||
token: ${{ secrets.GH_TOKEN }}
|
||||
validate: true
|
||||
- run: echo "::remove-matcher owner=gcc-strip3::"
|
||||
|
||||
- name: Setup python
|
||||
id: python
|
||||
if: false
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11'
|
||||
|
||||
- name: Generate gcov report
|
||||
id: test_report
|
||||
# any except canceled or skipped
|
||||
# TODO: fix coverage, no .gcno files are being created
|
||||
# TODO: .gcno files are supposed to be created next to .o files
|
||||
if: false
|
||||
# if: >-
|
||||
# always() &&
|
||||
# matrix.release != true &&
|
||||
# (steps.test.outcome == 'success' || steps.test.outcome == 'failure')
|
||||
run: |
|
||||
cp -rf ${{ steps.test.outputs.buildpath }}/build/ ./build/
|
||||
cd build
|
||||
ls -Ra
|
||||
|
||||
${{ steps.python.outputs.python-path }} -m pip install gcovr
|
||||
${{ steps.python.outputs.python-path }} -m gcovr . -r ../src \
|
||||
--exclude-noncode-lines \
|
||||
--exclude-throw-branches \
|
||||
--exclude-unreachable-branches \
|
||||
--verbose \
|
||||
--xml-pretty \
|
||||
-o coverage.xml
|
||||
|
||||
- name: Upload coverage artifact
|
||||
if: >-
|
||||
always() &&
|
||||
matrix.release != true &&
|
||||
(steps.test.outcome == 'success' || steps.test.outcome == 'failure') &&
|
||||
startsWith(github.repository, 'LizardByte/')
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: coverage-Homebrew-${{ matrix.os_name }}-${{ matrix.os_version }}
|
||||
path: |
|
||||
build/coverage.xml
|
||||
${{ steps.test.outputs.testpath }}/test_results.xml
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Patch homebrew formula
|
||||
# create beta version of the formula
|
||||
# don't run this on macOS, as the sed command fails
|
||||
if: matrix.release
|
||||
run: |
|
||||
# variables
|
||||
formula_file="homebrew/sunshine-beta.rb"
|
||||
|
||||
# rename the file
|
||||
mv homebrew/sunshine.rb $formula_file
|
||||
|
||||
# update the formula
|
||||
sed -i 's/class Sunshine < Formula/class SunshineBeta < Formula/' $formula_file
|
||||
sed -i 's/# conflicts_with/conflicts_with/' $formula_file
|
||||
|
||||
# print new file
|
||||
echo "New formula:"
|
||||
cat $formula_file
|
||||
|
||||
- name: Upload Artifacts (Beta)
|
||||
if: matrix.release
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: beta-Homebrew
|
||||
path: homebrew/
|
||||
if-no-files-found: error
|
||||
218
.github/workflows/ci-linux.yml
vendored
Normal file
218
.github/workflows/ci-linux.yml
vendored
Normal file
@@ -0,0 +1,218 @@
|
||||
---
|
||||
name: CI-Linux
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
release_commit:
|
||||
required: true
|
||||
type: string
|
||||
release_version:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
build_linux:
|
||||
name: ${{ matrix.name }}
|
||||
env:
|
||||
APP_ID: dev.lizardbyte.app.Sunshine
|
||||
runs-on: ubuntu-${{ matrix.dist }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- name: AppImage
|
||||
EXTRA_ARGS: '--appimage-build'
|
||||
dist: 22.04
|
||||
steps:
|
||||
- name: Maximize build space
|
||||
uses: easimon/maximize-build-space@v10
|
||||
with:
|
||||
root-reserve-mb: 30720
|
||||
remove-dotnet: 'true'
|
||||
remove-android: 'true'
|
||||
remove-haskell: 'true'
|
||||
remove-codeql: 'true'
|
||||
remove-docker-images: 'true'
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Setup Dependencies Linux
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
# create the artifacts directory
|
||||
mkdir -p artifacts
|
||||
|
||||
# allow libfuse2 for appimage on 22.04+
|
||||
sudo add-apt-repository universe
|
||||
|
||||
sudo apt-get install -y \
|
||||
libdrm-dev \
|
||||
libfuse2 \
|
||||
libgl-dev \
|
||||
libwayland-dev \
|
||||
libx11-xcb-dev \
|
||||
libxcb-dri3-dev \
|
||||
libxfixes-dev
|
||||
|
||||
- name: Setup python
|
||||
id: python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11'
|
||||
|
||||
- name: Build latest libva
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
gh release download --archive=tar.gz --repo=intel/libva
|
||||
tar xzf libva-*.tar.gz && rm libva-*.tar.gz
|
||||
cd libva-*
|
||||
./autogen.sh --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu \
|
||||
--enable-drm \
|
||||
--enable-x11 \
|
||||
--enable-glx \
|
||||
--enable-wayland \
|
||||
--without-legacy
|
||||
make -j "$(nproc)"
|
||||
sudo make install
|
||||
cd .. && rm -rf libva-*
|
||||
|
||||
- name: Build Linux
|
||||
env:
|
||||
BRANCH: ${{ github.head_ref || github.ref_name }}
|
||||
BUILD_VERSION: ${{ inputs.release_version }}
|
||||
COMMIT: ${{ inputs.release_commit }}
|
||||
run: |
|
||||
chmod +x ./scripts/linux_build.sh
|
||||
echo "::add-matcher::.github/matchers/gcc.json"
|
||||
./scripts/linux_build.sh \
|
||||
--publisher-name='${{ github.repository_owner }}' \
|
||||
--publisher-website='https://app.lizardbyte.dev' \
|
||||
--publisher-issue-url='https://app.lizardbyte.dev/support' \
|
||||
--skip-cleanup \
|
||||
--skip-package \
|
||||
--ubuntu-test-repo ${{ matrix.EXTRA_ARGS }}
|
||||
echo "::remove-matcher owner=gcc::"
|
||||
|
||||
- name: Set AppImage Version
|
||||
if: matrix.name == 'AppImage'
|
||||
run: |
|
||||
version=${{ inputs.release_version }}
|
||||
echo "VERSION=${version}" >> "${GITHUB_ENV}"
|
||||
|
||||
- name: Package Linux - AppImage
|
||||
if: matrix.name == 'AppImage'
|
||||
working-directory: build
|
||||
run: |
|
||||
# install sunshine to the DESTDIR
|
||||
DESTDIR=AppDir ninja install
|
||||
|
||||
# custom AppRun file
|
||||
cp -f ../packaging/linux/AppImage/AppRun ./AppDir/
|
||||
chmod +x ./AppDir/AppRun
|
||||
|
||||
# variables
|
||||
DESKTOP_FILE="${DESKTOP_FILE:-${APP_ID}.desktop}"
|
||||
ICON_FILE="${ICON_FILE:-sunshine.png}"
|
||||
|
||||
# AppImage
|
||||
# https://docs.appimage.org/packaging-guide/index.html
|
||||
wget -q https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
|
||||
chmod +x linuxdeploy-x86_64.AppImage
|
||||
|
||||
# https://github.com/linuxdeploy/linuxdeploy-plugin-gtk
|
||||
sudo apt-get install libgtk-3-dev librsvg2-dev -y
|
||||
wget -q https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh
|
||||
chmod +x linuxdeploy-plugin-gtk.sh
|
||||
export DEPLOY_GTK_VERSION=3
|
||||
|
||||
./linuxdeploy-x86_64.AppImage \
|
||||
--appdir ./AppDir \
|
||||
--plugin gtk \
|
||||
--executable ./sunshine \
|
||||
--icon-file "../$ICON_FILE" \
|
||||
--desktop-file "./$DESKTOP_FILE" \
|
||||
--output appimage
|
||||
|
||||
# move
|
||||
mv Sunshine*.AppImage ../artifacts/sunshine.AppImage
|
||||
|
||||
# permissions
|
||||
chmod +x ../artifacts/sunshine.AppImage
|
||||
|
||||
- name: Delete CUDA
|
||||
# free up space on the runner
|
||||
run: |
|
||||
rm -rf ./build/cuda
|
||||
|
||||
- name: Verify AppImage
|
||||
if: matrix.name == 'AppImage'
|
||||
run: |
|
||||
wget https://github.com/TheAssassin/appimagelint/releases/download/continuous/appimagelint-x86_64.AppImage
|
||||
chmod +x appimagelint-x86_64.AppImage
|
||||
|
||||
./appimagelint-x86_64.AppImage ./artifacts/sunshine.AppImage
|
||||
|
||||
- name: Install test deps
|
||||
run: |
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install -y \
|
||||
x11-xserver-utils \
|
||||
xvfb
|
||||
|
||||
# clean apt cache
|
||||
sudo apt-get clean
|
||||
sudo rm -rf /var/lib/apt/lists/*
|
||||
|
||||
- name: Run tests
|
||||
id: test
|
||||
working-directory: build/tests
|
||||
run: |
|
||||
export DISPLAY=:1
|
||||
Xvfb ${DISPLAY} -screen 0 1024x768x24 &
|
||||
sleep 5 # give Xvfb time to start
|
||||
|
||||
./test_sunshine --gtest_color=yes --gtest_output=xml:test_results.xml
|
||||
|
||||
- name: Generate gcov report
|
||||
id: test_report
|
||||
# any except canceled or skipped
|
||||
if: >-
|
||||
always() &&
|
||||
(steps.test.outcome == 'success' || steps.test.outcome == 'failure')
|
||||
working-directory: build
|
||||
run: |
|
||||
${{ steps.python.outputs.python-path }} -m pip install gcovr
|
||||
${{ steps.python.outputs.python-path }} -m gcovr . -r ../src \
|
||||
--exclude-noncode-lines \
|
||||
--exclude-throw-branches \
|
||||
--exclude-unreachable-branches \
|
||||
--verbose \
|
||||
--xml-pretty \
|
||||
-o coverage.xml
|
||||
|
||||
- name: Upload coverage artifact
|
||||
if: >-
|
||||
always() &&
|
||||
(steps.test_report.outcome == 'success')
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: coverage-Linux-${{ matrix.name }}
|
||||
path: |
|
||||
build/coverage.xml
|
||||
build/tests/test_results.xml
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload Artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: build-Linux-${{ matrix.name }}
|
||||
path: artifacts/
|
||||
if-no-files-found: error
|
||||
347
.github/workflows/ci-windows.yml
vendored
Normal file
347
.github/workflows/ci-windows.yml
vendored
Normal file
@@ -0,0 +1,347 @@
|
||||
---
|
||||
name: CI-Windows
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
release_commit:
|
||||
required: true
|
||||
type: string
|
||||
release_version:
|
||||
required: true
|
||||
type: string
|
||||
secrets:
|
||||
CODECOV_TOKEN:
|
||||
required: false
|
||||
|
||||
jobs:
|
||||
build_windows:
|
||||
name: ${{ matrix.name }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
defaults:
|
||||
run:
|
||||
shell: msys2 {0}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- name: Windows-AMD64
|
||||
os: windows-2022
|
||||
arch: x86_64
|
||||
msystem: ucrt64
|
||||
toolchain: ucrt-x86_64
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Prepare tests
|
||||
id: prepare-tests
|
||||
if: false # todo: DirectX11 is not available, so even software encoder fails
|
||||
shell: pwsh
|
||||
run: |
|
||||
# function to download and extract a zip file
|
||||
function DownloadAndExtract {
|
||||
param (
|
||||
[string]$Uri,
|
||||
[string]$OutFile
|
||||
)
|
||||
|
||||
$maxRetries = 5
|
||||
$retryCount = 0
|
||||
$success = $false
|
||||
|
||||
while (-not $success -and $retryCount -lt $maxRetries) {
|
||||
$retryCount++
|
||||
Write-Host "Downloading $Uri to $OutFile, attempt $retryCount of $maxRetries"
|
||||
try {
|
||||
Invoke-WebRequest -Uri $Uri -OutFile $OutFile
|
||||
$success = $true
|
||||
} catch {
|
||||
Write-Host "Attempt $retryCount of $maxRetries failed with error: $($_.Exception.Message). Retrying..."
|
||||
Start-Sleep -Seconds 5
|
||||
}
|
||||
}
|
||||
|
||||
if (-not $success) {
|
||||
Write-Host "Failed to download the file after $maxRetries attempts."
|
||||
exit 1
|
||||
}
|
||||
|
||||
# use .NET to get the base name of the file
|
||||
$baseName = (Get-Item $OutFile).BaseName
|
||||
|
||||
# Extract the zip file
|
||||
Expand-Archive -Path $OutFile -DestinationPath $baseName
|
||||
}
|
||||
|
||||
# virtual display driver
|
||||
DownloadAndExtract `
|
||||
-Uri "https://www.amyuni.com/downloads/usbmmidd_v2.zip" `
|
||||
-OutFile "usbmmidd_v2.zip"
|
||||
|
||||
# install
|
||||
Set-Location -Path usbmmidd_v2/usbmmidd_v2
|
||||
./deviceinstaller64 install usbmmidd.inf usbmmidd
|
||||
|
||||
# create the virtual display
|
||||
./deviceinstaller64 enableidd 1
|
||||
|
||||
# move up a directory
|
||||
Set-Location -Path ../..
|
||||
|
||||
# install devcon
|
||||
DownloadAndExtract `
|
||||
-Uri "https://github.com/Drawbackz/DevCon-Installer/releases/download/1.4-rc/Devcon.Installer.zip" `
|
||||
-OutFile "Devcon.Installer.zip"
|
||||
Set-Location -Path Devcon.Installer
|
||||
# hash needs to match OS version
|
||||
# https://github.com/Drawbackz/DevCon-Installer/blob/master/devcon_sources.json
|
||||
Start-Process -FilePath "./Devcon Installer.exe" -Wait -ArgumentList `
|
||||
'install', `
|
||||
'-hash', '54004C83EE34F6A55380528A8B29F4C400E61FBB947A19E0AB9E5A193D7D961E', `
|
||||
'-addpath', `
|
||||
'-update', `
|
||||
'-dir', 'C:\Windows\System32'
|
||||
|
||||
# disable Hyper-V Video
|
||||
# https://stackoverflow.com/a/59490940
|
||||
C:\Windows\System32\devcon.exe disable "VMBUS\{da0a7802-e377-4aac-8e77-0558eb1073f8}"
|
||||
|
||||
# move up a directory
|
||||
Set-Location -Path ..
|
||||
|
||||
# multi monitor tool
|
||||
DownloadAndExtract `
|
||||
-Uri "http://www.nirsoft.net/utils/multimonitortool-x64.zip" `
|
||||
-OutFile "multimonitortool.zip"
|
||||
|
||||
# enable the virtual display
|
||||
# http://www.nirsoft.net/utils/multi_monitor_tool.html
|
||||
Set-Location -Path multimonitortool
|
||||
|
||||
# Original Hyper-V is \\.\DISPLAY1, it will recreate itself as \\.\DISPLAY6 (or something higher than 2)
|
||||
# USB Mobile Monitor Virtual Display is \\.\DISPLAY2
|
||||
|
||||
# these don't seem to work if not using runAs
|
||||
# todo: do they work if not using runAs?
|
||||
Start-Process powershell -Verb runAs -ArgumentList '-Command ./MultiMonitorTool.exe /enable \\.\DISPLAY2'
|
||||
Start-Process powershell -Verb runAs -ArgumentList '-Command ./MultiMonitorTool.exe /SetPrimary \\.\DISPLAY2'
|
||||
|
||||
# wait a few seconds
|
||||
Start-Sleep -s 5
|
||||
|
||||
# list monitors
|
||||
./MultiMonitorTool.exe /stext monitor_list.txt
|
||||
|
||||
# wait a few seconds
|
||||
Start-Sleep -s 5
|
||||
|
||||
# print the monitor list
|
||||
Get-Content -Path monitor_list.txt
|
||||
|
||||
- name: Setup Dependencies Windows
|
||||
# if a dependency needs to be pinned, see https://github.com/LizardByte/build-deps/pull/186
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: ${{ matrix.msystem }}
|
||||
update: true
|
||||
install: >-
|
||||
wget
|
||||
|
||||
- name: Update Windows dependencies
|
||||
env:
|
||||
MSYSTEM: ${{ matrix.msystem }}
|
||||
TOOLCHAIN: ${{ matrix.toolchain }}
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
# variables
|
||||
declare -A pinned_deps
|
||||
|
||||
# dependencies
|
||||
dependencies=(
|
||||
"git"
|
||||
"mingw-w64-${TOOLCHAIN}-cmake"
|
||||
"mingw-w64-${TOOLCHAIN}-cppwinrt"
|
||||
"mingw-w64-${TOOLCHAIN}-curl-winssl"
|
||||
"mingw-w64-${TOOLCHAIN}-gcc"
|
||||
"mingw-w64-${TOOLCHAIN}-graphviz"
|
||||
"mingw-w64-${TOOLCHAIN}-MinHook"
|
||||
"mingw-w64-${TOOLCHAIN}-miniupnpc"
|
||||
"mingw-w64-${TOOLCHAIN}-nlohmann-json"
|
||||
"mingw-w64-${TOOLCHAIN}-nodejs"
|
||||
"mingw-w64-${TOOLCHAIN}-nsis"
|
||||
"mingw-w64-${TOOLCHAIN}-onevpl"
|
||||
"mingw-w64-${TOOLCHAIN}-openssl"
|
||||
"mingw-w64-${TOOLCHAIN}-opus"
|
||||
"mingw-w64-${TOOLCHAIN}-toolchain"
|
||||
)
|
||||
|
||||
# do not modify below this line
|
||||
|
||||
ignore_packages=()
|
||||
tarballs=""
|
||||
for pkg in "${!pinned_deps[@]}"; do
|
||||
ignore_packages+=("${pkg}")
|
||||
version="${pinned_deps[$pkg]}"
|
||||
tarball="${pkg}-${version}-any.pkg.tar.zst"
|
||||
|
||||
# download working version
|
||||
wget "https://repo.msys2.org/mingw/${MSYSTEM}/${tarball}"
|
||||
|
||||
tarballs="${tarballs} ${tarball}"
|
||||
done
|
||||
|
||||
# Create the ignore string for pacman
|
||||
ignore_list=$(IFS=,; echo "${ignore_packages[*]}")
|
||||
|
||||
# install pinned dependencies
|
||||
if [ -n "${tarballs}" ]; then
|
||||
pacman -U --noconfirm "${tarballs}"
|
||||
fi
|
||||
|
||||
# Only add --ignore if we have packages to ignore
|
||||
if [ -n "${ignore_list}" ]; then
|
||||
pacman -Syu --noconfirm --ignore="${ignore_list}" "${dependencies[@]}"
|
||||
else
|
||||
pacman -Syu --noconfirm "${dependencies[@]}"
|
||||
fi
|
||||
|
||||
- name: Install Doxygen
|
||||
# GCC compiled doxygen has issues when running graphviz
|
||||
env:
|
||||
DOXYGEN_VERSION: "1.11.0"
|
||||
shell: pwsh
|
||||
run: |
|
||||
# Set version variables
|
||||
$doxy_ver = $env:DOXYGEN_VERSION
|
||||
$_doxy_ver = $doxy_ver.Replace(".", "_")
|
||||
|
||||
# Download the Doxygen installer
|
||||
Invoke-WebRequest -Uri `
|
||||
"https://github.com/doxygen/doxygen/releases/download/Release_${_doxy_ver}/doxygen-${doxy_ver}-setup.exe" `
|
||||
-OutFile "doxygen-setup.exe"
|
||||
|
||||
# Run the installer
|
||||
Start-Process `
|
||||
-FilePath .\doxygen-setup.exe `
|
||||
-ArgumentList `
|
||||
'/VERYSILENT' `
|
||||
-Wait `
|
||||
-NoNewWindow
|
||||
|
||||
# Clean up
|
||||
Remove-Item -Path doxygen-setup.exe
|
||||
|
||||
- name: Setup python
|
||||
id: setup-python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11'
|
||||
|
||||
- name: Python Path
|
||||
id: python-path
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
# replace backslashes with double backslashes
|
||||
python_path=$(echo "${{ steps.setup-python.outputs.python-path }}" | sed 's/\\/\\\\/g')
|
||||
|
||||
# step output
|
||||
echo "python-path=${python_path}"
|
||||
echo "python-path=${python_path}" >> "${GITHUB_OUTPUT}"
|
||||
|
||||
- name: Build Windows
|
||||
shell: msys2 {0}
|
||||
env:
|
||||
BRANCH: ${{ github.head_ref || github.ref_name }}
|
||||
BUILD_VERSION: ${{ inputs.release_version }}
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
COMMIT: ${{ inputs.release_commit }}
|
||||
run: |
|
||||
mkdir -p build
|
||||
cmake \
|
||||
-B build \
|
||||
-G Ninja \
|
||||
-S . \
|
||||
-DBUILD_WERROR=ON \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DSUNSHINE_ASSETS_DIR=assets \
|
||||
-DSUNSHINE_PUBLISHER_NAME='${{ github.repository_owner }}' \
|
||||
-DSUNSHINE_PUBLISHER_WEBSITE='https://app.lizardbyte.dev' \
|
||||
-DSUNSHINE_PUBLISHER_ISSUE_URL='https://app.lizardbyte.dev/support'
|
||||
echo "::add-matcher::.github/matchers/gcc.json"
|
||||
ninja -C build
|
||||
echo "::remove-matcher owner=gcc::"
|
||||
|
||||
- name: Package Windows
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
mkdir -p artifacts
|
||||
cd build
|
||||
|
||||
# package
|
||||
cpack -G NSIS
|
||||
cpack -G ZIP
|
||||
|
||||
# move
|
||||
mv ./cpack_artifacts/Sunshine.exe ../artifacts/Sunshine-${{ matrix.name }}-installer.exe
|
||||
mv ./cpack_artifacts/Sunshine.zip ../artifacts/Sunshine-${{ matrix.name }}-portable.zip
|
||||
|
||||
- name: Run tests
|
||||
id: test
|
||||
shell: msys2 {0}
|
||||
working-directory: build/tests
|
||||
run: |
|
||||
./test_sunshine.exe --gtest_color=yes --gtest_output=xml:test_results.xml
|
||||
|
||||
- name: Generate gcov report
|
||||
id: test_report
|
||||
# any except canceled or skipped
|
||||
if: always() && (steps.test.outcome == 'success' || steps.test.outcome == 'failure')
|
||||
shell: msys2 {0}
|
||||
working-directory: build
|
||||
run: |
|
||||
${{ steps.python-path.outputs.python-path }} -m pip install gcovr
|
||||
${{ steps.python-path.outputs.python-path }} -m gcovr . -r ../src \
|
||||
--exclude-noncode-lines \
|
||||
--exclude-throw-branches \
|
||||
--exclude-unreachable-branches \
|
||||
--verbose \
|
||||
--xml-pretty \
|
||||
-o coverage.xml
|
||||
|
||||
- name: Upload coverage artifact
|
||||
if: >-
|
||||
always() &&
|
||||
(steps.test_report.outcome == 'success')
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: coverage-${{ matrix.name }}
|
||||
path: |
|
||||
build/coverage.xml
|
||||
build/tests/test_results.xml
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Package Windows Debug Info
|
||||
shell: pwsh
|
||||
working-directory: build
|
||||
run: |
|
||||
# use .dbg file extension for binaries to avoid confusion with real packages
|
||||
Get-ChildItem -File -Recurse | `
|
||||
% { Rename-Item -Path $_.PSPath -NewName $_.Name.Replace(".exe",".dbg") }
|
||||
|
||||
# save the binaries with debug info
|
||||
7z -r `
|
||||
"-xr!CMakeFiles" `
|
||||
"-xr!cpack_artifacts" `
|
||||
a "../artifacts/Sunshine-${{ matrix.name }}-debuginfo.7z" "*.dbg"
|
||||
|
||||
- name: Upload Artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: build-${{ matrix.name }}
|
||||
path: artifacts/
|
||||
if-no-files-found: error
|
||||
241
.github/workflows/ci.yml
vendored
Normal file
241
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,241 @@
|
||||
---
|
||||
name: CI
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
- reopened
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: "${{ github.workflow }}-${{ github.ref }}"
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
github-env:
|
||||
name: GitHub Env Debug
|
||||
uses: LizardByte/.github/.github/workflows/__call-github-env.yml@master
|
||||
|
||||
release-setup:
|
||||
name: Release Setup
|
||||
outputs:
|
||||
publish_release: ${{ steps.release-setup.outputs.publish_release }}
|
||||
release_body: ${{ steps.release-setup.outputs.release_body }}
|
||||
release_commit: ${{ steps.release-setup.outputs.release_commit }}
|
||||
release_generate_release_notes: ${{ steps.release-setup.outputs.release_generate_release_notes }}
|
||||
release_tag: ${{ steps.release-setup.outputs.release_tag }}
|
||||
release_version: ${{ steps.release-setup.outputs.release_version }}
|
||||
permissions:
|
||||
contents: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Release Setup
|
||||
id: release-setup
|
||||
uses: LizardByte/actions/actions/release_setup@v2025.715.25226
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
build-docker:
|
||||
name: Docker
|
||||
needs: release-setup
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
uses: LizardByte/.github/.github/workflows/__call-docker.yml@master
|
||||
with:
|
||||
maximize_build_space: true
|
||||
publish_release: ${{ needs.release-setup.outputs.publish_release }}
|
||||
release_commit: ${{ needs.release-setup.outputs.release_commit }}
|
||||
release_tag: ${{ needs.release-setup.outputs.release_tag }}
|
||||
release_version: ${{ needs.release-setup.outputs.release_version }}
|
||||
secrets:
|
||||
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
||||
DOCKER_HUB_ACCESS_TOKEN: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
||||
GH_BOT_NAME: ${{ secrets.GH_BOT_NAME }}
|
||||
GH_BOT_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
build-homebrew:
|
||||
name: Homebrew
|
||||
needs: release-setup
|
||||
uses: ./.github/workflows/ci-homebrew.yml
|
||||
with:
|
||||
publish_release: ${{ needs.release-setup.outputs.publish_release }}
|
||||
release_commit: ${{ needs.release-setup.outputs.release_commit }}
|
||||
release_tag: ${{ needs.release-setup.outputs.release_tag }}
|
||||
release_version: ${{ needs.release-setup.outputs.release_version }}
|
||||
secrets:
|
||||
GH_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
|
||||
GIT_EMAIL: ${{ secrets.GH_BOT_EMAIL }}
|
||||
GIT_USERNAME: ${{ secrets.GH_BOT_NAME }}
|
||||
|
||||
build-linux:
|
||||
name: Linux
|
||||
needs: release-setup
|
||||
uses: ./.github/workflows/ci-linux.yml
|
||||
with:
|
||||
release_commit: ${{ needs.release-setup.outputs.release_commit }}
|
||||
release_version: ${{ needs.release-setup.outputs.release_version }}
|
||||
|
||||
build-linux-copr:
|
||||
name: Linux Copr
|
||||
if: github.event_name != 'push' # releases are handled directly in ci-copr.yml
|
||||
needs: release-setup
|
||||
uses: ./.github/workflows/ci-copr.yml
|
||||
secrets:
|
||||
COPR_BETA_WEBHOOK_TOKEN: ${{ secrets.COPR_BETA_WEBHOOK_TOKEN }}
|
||||
COPR_STABLE_WEBHOOK_TOKEN: ${{ secrets.COPR_STABLE_WEBHOOK_TOKEN }}
|
||||
COPR_CLI_CONFIG: ${{ secrets.COPR_CLI_CONFIG }}
|
||||
|
||||
build-linux-flatpak:
|
||||
name: Linux Flatpak
|
||||
needs: release-setup
|
||||
uses: ./.github/workflows/ci-flatpak.yml
|
||||
with:
|
||||
release_commit: ${{ needs.release-setup.outputs.release_commit }}
|
||||
release_version: ${{ needs.release-setup.outputs.release_version }}
|
||||
|
||||
build-windows:
|
||||
name: Windows
|
||||
needs: release-setup
|
||||
uses: ./.github/workflows/ci-windows.yml
|
||||
with:
|
||||
release_commit: ${{ needs.release-setup.outputs.release_commit }}
|
||||
release_version: ${{ needs.release-setup.outputs.release_version }}
|
||||
secrets:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
coverage:
|
||||
name: Coverage-${{ matrix.name }}
|
||||
if: >-
|
||||
always() &&
|
||||
!cancelled() &&
|
||||
startsWith(github.repository, 'LizardByte/')
|
||||
needs:
|
||||
- build-linux
|
||||
- build-linux-flatpak
|
||||
- build-homebrew
|
||||
- build-windows
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- name: Linux-AppImage
|
||||
coverage: true
|
||||
- name: Homebrew-macos-13
|
||||
coverage: false
|
||||
- name: Homebrew-macos-14
|
||||
coverage: false
|
||||
- name: Homebrew-macos-15
|
||||
coverage: false
|
||||
- name: Homebrew-ubuntu-latest
|
||||
coverage: false
|
||||
- name: Windows-AMD64
|
||||
coverage: true
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Download coverage artifact
|
||||
uses: actions/download-artifact@v5
|
||||
with:
|
||||
name: coverage-${{ matrix.name }}
|
||||
path: _coverage
|
||||
|
||||
- name: Upload test results
|
||||
uses: codecov/test-results-action@v1
|
||||
with:
|
||||
disable_search: true
|
||||
fail_ci_if_error: true
|
||||
files: ./_coverage/tests/test_results.xml
|
||||
flags: ${{ matrix.name }}
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
verbose: true
|
||||
|
||||
- name: Upload coverage
|
||||
uses: codecov/codecov-action@v5
|
||||
if: matrix.coverage != false
|
||||
with:
|
||||
disable_search: true
|
||||
fail_ci_if_error: true
|
||||
files: ./_coverage/coverage.xml
|
||||
flags: ${{ matrix.name }}
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
verbose: true
|
||||
|
||||
release:
|
||||
name: Release
|
||||
if:
|
||||
needs.release-setup.outputs.publish_release == 'true' &&
|
||||
startsWith(github.repository, 'LizardByte/')
|
||||
needs:
|
||||
- release-setup
|
||||
- build-docker
|
||||
- build-linux
|
||||
- build-linux-flatpak
|
||||
- build-homebrew
|
||||
- build-windows
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Download build artifacts
|
||||
uses: actions/download-artifact@v5
|
||||
with:
|
||||
path: artifacts
|
||||
pattern: build-*
|
||||
merge-multiple: true
|
||||
|
||||
- name: Debug artifacts
|
||||
run: ls -l artifacts
|
||||
|
||||
- name: Create/Update GitHub Release
|
||||
uses: LizardByte/actions/actions/release_create@v2025.715.25226
|
||||
with:
|
||||
allowUpdates: false
|
||||
body: ${{ needs.release-setup.outputs.release_body }}
|
||||
generateReleaseNotes: ${{ needs.release-setup.outputs.release_generate_release_notes }}
|
||||
name: ${{ needs.release-setup.outputs.release_tag }}
|
||||
prerelease: true
|
||||
tag: ${{ needs.release-setup.outputs.release_tag }}
|
||||
token: ${{ secrets.GH_BOT_TOKEN }}
|
||||
virustotal_api_key: ${{ secrets.VIRUSTOTAL_API_KEY }}
|
||||
|
||||
release-homebrew-beta:
|
||||
name: Release Homebrew Beta
|
||||
if:
|
||||
needs.release-setup.outputs.publish_release == 'true' &&
|
||||
startsWith(github.repository, 'LizardByte/')
|
||||
needs:
|
||||
- release-setup
|
||||
- build-homebrew
|
||||
- release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Download homebrew artifacts
|
||||
uses: actions/download-artifact@v5
|
||||
with:
|
||||
name: beta-Homebrew
|
||||
path: homebrew
|
||||
|
||||
- name: Upload Homebrew Beta Formula
|
||||
uses: LizardByte/actions/actions/release_homebrew@v2025.715.25226
|
||||
with:
|
||||
formula_file: ${{ github.workspace }}/homebrew/sunshine-beta.rb
|
||||
git_email: ${{ secrets.GH_BOT_EMAIL }}
|
||||
git_username: ${{ secrets.GH_BOT_NAME }}
|
||||
publish: true
|
||||
token: ${{ secrets.GH_BOT_TOKEN }}
|
||||
validate: false
|
||||
250
.github/workflows/codeql.yml
vendored
250
.github/workflows/codeql.yml
vendored
@@ -1,250 +0,0 @@
|
||||
---
|
||||
# This workflow is centrally managed in https://github.com/<organization>/.github/
|
||||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||
# the above-mentioned repo.
|
||||
|
||||
# This workflow will analyze all supported languages in the repository using CodeQL Analysis.
|
||||
|
||||
name: "CodeQL"
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
schedule:
|
||||
- cron: '00 12 * * 0' # every Sunday at 12:00 UTC
|
||||
|
||||
concurrency:
|
||||
group: "${{ github.workflow }}-${{ github.ref }}"
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
languages:
|
||||
name: Get language matrix
|
||||
outputs:
|
||||
matrix: ${{ steps.lang.outputs.result }}
|
||||
continue: ${{ steps.continue.outputs.result }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Get repo languages
|
||||
id: lang
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
// CodeQL supports ['cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift']
|
||||
// Use only 'java' to analyze code written in Java, Kotlin or both
|
||||
// Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
|
||||
// Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
|
||||
const supported_languages = ['cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift']
|
||||
|
||||
const remap_languages = {
|
||||
'c++': 'cpp',
|
||||
'c#': 'csharp',
|
||||
'kotlin': 'java',
|
||||
'typescript': 'javascript',
|
||||
}
|
||||
|
||||
const repo = context.repo
|
||||
const response = await github.rest.repos.listLanguages(repo)
|
||||
let matrix = {
|
||||
"include": []
|
||||
}
|
||||
|
||||
// Track languages we've already added to avoid duplicates
|
||||
const addedLanguages = new Set()
|
||||
|
||||
// Check if workflow files exist to determine if we should add actions language
|
||||
const fs = require('fs');
|
||||
const hasYmlFiles = fs.existsSync('.github/workflows') &&
|
||||
fs.readdirSync('.github/workflows').some(file => file.endsWith('.yml') || file.endsWith('.yaml'));
|
||||
|
||||
// Add actions language if workflow files exist
|
||||
if (hasYmlFiles) {
|
||||
console.log('Found GitHub Actions workflow files. Adding actions to the matrix.');
|
||||
matrix['include'].push({
|
||||
"category": "/language:actions",
|
||||
"language": "actions",
|
||||
"name": "actions",
|
||||
"os": "ubuntu-latest"
|
||||
});
|
||||
}
|
||||
|
||||
for (let [key, value] of Object.entries(response.data)) {
|
||||
// remap language
|
||||
if (remap_languages[key.toLowerCase()]) {
|
||||
console.log(`Remapping language: ${key} to ${remap_languages[key.toLowerCase()]}`)
|
||||
key = remap_languages[key.toLowerCase()]
|
||||
}
|
||||
|
||||
const normalizedKey = key.toLowerCase()
|
||||
|
||||
if (supported_languages.includes(normalizedKey) && !addedLanguages.has(normalizedKey)) {
|
||||
// Mark this language as added
|
||||
addedLanguages.add(normalizedKey)
|
||||
|
||||
console.log(`Found supported language: ${normalizedKey}`)
|
||||
let osList = ['ubuntu-latest'];
|
||||
if (normalizedKey === 'swift') {
|
||||
osList = ['macos-latest'];
|
||||
} else if (normalizedKey === 'cpp') {
|
||||
osList = ['macos-latest', 'ubuntu-latest', 'windows-latest'];
|
||||
}
|
||||
for (let os of osList) {
|
||||
// set name for matrix
|
||||
let name = osList.length === 1 ? normalizedKey : `${normalizedKey}, ${os}`
|
||||
|
||||
// set category for matrix
|
||||
let category = `/language:${normalizedKey}`
|
||||
if (normalizedKey === 'cpp') {
|
||||
category = `/language:cpp-${os.split('-')[0]}`
|
||||
}
|
||||
|
||||
// add to matrix
|
||||
matrix['include'].push({
|
||||
"category": category,
|
||||
"language": normalizedKey,
|
||||
"name": name,
|
||||
"os": os
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// print languages
|
||||
console.log(`matrix: ${JSON.stringify(matrix)}`)
|
||||
|
||||
return matrix
|
||||
|
||||
- name: Continue
|
||||
id: continue
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
// if matrix['include'] is an empty list return false, otherwise true
|
||||
const matrix = ${{ steps.lang.outputs.result }} // this is already json encoded
|
||||
|
||||
if (matrix['include'].length == 0) {
|
||||
return false
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
|
||||
analyze:
|
||||
name: Analyze (${{ matrix.name }})
|
||||
if: needs.languages.outputs.continue == 'true'
|
||||
defaults:
|
||||
run:
|
||||
shell: ${{ matrix.os == 'windows-latest' && 'msys2 {0}' || 'bash' }}
|
||||
env:
|
||||
GITHUB_CODEQL_BUILD: true
|
||||
needs: languages
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
security-events: write
|
||||
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{ fromJson(needs.languages.outputs.matrix) }}
|
||||
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
|
||||
steps:
|
||||
- name: Maximize build space
|
||||
if: >-
|
||||
runner.os == 'Linux' &&
|
||||
matrix.language == 'cpp'
|
||||
uses: easimon/maximize-build-space@v10
|
||||
with:
|
||||
root-reserve-mb: 30720
|
||||
remove-dotnet: ${{ (matrix.language == 'csharp' && 'false') || 'true' }}
|
||||
remove-android: 'true'
|
||||
remove-haskell: 'true'
|
||||
remove-codeql: 'false'
|
||||
remove-docker-images: 'true'
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Setup msys2
|
||||
if: >-
|
||||
runner.os == 'Windows' &&
|
||||
matrix.language == 'cpp'
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: ucrt64
|
||||
update: true
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
# By default, queries listed here will override any specified in a config file.
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
|
||||
# yamllint disable-line rule:line-length
|
||||
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
||||
# queries: security-extended,security-and-quality
|
||||
config: |
|
||||
paths-ignore:
|
||||
- build
|
||||
- node_modules
|
||||
- third-party
|
||||
|
||||
# Pre autobuild
|
||||
# create a file named .codeql-prebuild-${{ matrix.language }}-${{ runner.os }}.sh in the root of your repository
|
||||
- name: Prebuild
|
||||
id: prebuild
|
||||
run: |
|
||||
# check if prebuild script exists
|
||||
filename=".codeql-prebuild-${{ matrix.language }}-${{ runner.os }}.sh"
|
||||
if [ -f "./${filename}" ]; then
|
||||
echo "Running prebuild script: ${filename}"
|
||||
./${filename}
|
||||
fi
|
||||
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
|
||||
- name: Autobuild
|
||||
if: steps.prebuild.outputs.skip_autobuild != 'true'
|
||||
uses: github/codeql-action/autobuild@v3
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v3
|
||||
with:
|
||||
category: "${{ matrix.category }}"
|
||||
output: sarif-results
|
||||
upload: failure-only
|
||||
|
||||
- name: filter-sarif
|
||||
uses: advanced-security/filter-sarif@v1
|
||||
with:
|
||||
input: sarif-results/${{ matrix.language }}.sarif
|
||||
output: sarif-results/${{ matrix.language }}.sarif
|
||||
patterns: |
|
||||
-build/**
|
||||
-node_modules/**
|
||||
-third\-party/**
|
||||
|
||||
- name: Upload SARIF
|
||||
uses: github/codeql-action/upload-sarif@v3
|
||||
with:
|
||||
category: "${{ matrix.category }}"
|
||||
sarif_file: sarif-results/${{ matrix.language }}.sarif
|
||||
|
||||
- name: Upload loc as a Build Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: sarif-results-${{ matrix.language }}-${{ runner.os }}
|
||||
path: sarif-results
|
||||
if-no-files-found: error
|
||||
retention-days: 1
|
||||
273
.github/workflows/common-lint.yml
vendored
273
.github/workflows/common-lint.yml
vendored
@@ -1,273 +0,0 @@
|
||||
---
|
||||
# This workflow is centrally managed in https://github.com/<organization>/.github/
|
||||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||
# the above-mentioned repo.
|
||||
|
||||
# Common linting.
|
||||
|
||||
name: common lint
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
- reopened
|
||||
|
||||
concurrency:
|
||||
group: "${{ github.workflow }}-${{ github.ref }}"
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Common Lint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.12'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade \
|
||||
pip \
|
||||
setuptools \
|
||||
wheel \
|
||||
cmakelang \
|
||||
flake8 \
|
||||
nb-clean \
|
||||
nbqa[toolchain]
|
||||
|
||||
- name: C++ - find files
|
||||
id: cpp_files
|
||||
run: |
|
||||
# find files
|
||||
found_files=$(find . -type f \
|
||||
-iname "*.c" -o \
|
||||
-iname "*.cpp" -o \
|
||||
-iname "*.h" -o \
|
||||
-iname "*.hpp" -o \
|
||||
-iname "*.m" -o \
|
||||
-iname "*.mm" \
|
||||
)
|
||||
ignore_files=$(find . -type f -iname ".clang-format-ignore")
|
||||
|
||||
# Loop through each C++ file
|
||||
for file in $found_files; do
|
||||
for ignore_file in $ignore_files; do
|
||||
ignore_directory=$(dirname "$ignore_file")
|
||||
# if directory of ignore_file is beginning of file
|
||||
if [[ "$file" == "$ignore_directory"* ]]; then
|
||||
echo "ignoring file: ${file}"
|
||||
found_files="${found_files//${file}/}"
|
||||
break 1
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
# remove empty lines
|
||||
found_files=$(echo "$found_files" | sed '/^\s*$/d')
|
||||
|
||||
echo "found cpp files: ${found_files}"
|
||||
|
||||
# do not quote to keep this as a single line
|
||||
echo found_files=${found_files} >> $GITHUB_OUTPUT
|
||||
|
||||
- name: C++ - Clang format lint
|
||||
if: always() && steps.cpp_files.outputs.found_files
|
||||
uses: DoozyX/clang-format-lint-action@v0.20
|
||||
with:
|
||||
source: ${{ steps.cpp_files.outputs.found_files }}
|
||||
clangFormatVersion: '20'
|
||||
extensions: 'c,cpp,h,hpp,m,mm'
|
||||
style: file
|
||||
inplace: false
|
||||
|
||||
- name: CMake - find files
|
||||
id: cmake_files
|
||||
if: always()
|
||||
run: |
|
||||
# find files
|
||||
found_files=$(find . -type f -iname "CMakeLists.txt" -o -iname "*.cmake")
|
||||
ignore_files=$(find . -type f -iname ".cmake-lint-ignore")
|
||||
|
||||
# Loop through each C++ file
|
||||
for file in $found_files; do
|
||||
for ignore_file in $ignore_files; do
|
||||
ignore_directory=$(dirname "$ignore_file")
|
||||
# if directory of ignore_file is beginning of file
|
||||
if [[ "$file" == "$ignore_directory"* ]]; then
|
||||
echo "ignoring file: ${file}"
|
||||
found_files="${found_files//${file}/}"
|
||||
break 1
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
# remove empty lines
|
||||
found_files=$(echo "$found_files" | sed '/^\s*$/d')
|
||||
|
||||
echo "found cmake files: ${found_files}"
|
||||
|
||||
# do not quote to keep this as a single line
|
||||
echo found_files=${found_files} >> $GITHUB_OUTPUT
|
||||
|
||||
- name: CMake - cmake-lint
|
||||
if: always() && steps.cmake_files.outputs.found_files
|
||||
run: |
|
||||
cmake-lint --line-width 120 --tab-size 4 ${{ steps.cmake_files.outputs.found_files }}
|
||||
|
||||
- name: Docker - find files
|
||||
id: dokcer_files
|
||||
if: always()
|
||||
run: |
|
||||
found_files=$(find . -type f -iname "Dockerfile" -o -iname "*.dockerfile")
|
||||
|
||||
echo "found_files: ${found_files}"
|
||||
|
||||
# do not quote to keep this as a single line
|
||||
echo found_files=${found_files} >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Docker - hadolint
|
||||
if: always() && steps.dokcer_files.outputs.found_files
|
||||
run: |
|
||||
docker pull hadolint/hadolint
|
||||
|
||||
# create hadolint config file
|
||||
cat <<EOF > .hadolint.yaml
|
||||
---
|
||||
ignored:
|
||||
- DL3008
|
||||
- DL3013
|
||||
- DL3016
|
||||
- DL3018
|
||||
- DL3028
|
||||
- DL3059
|
||||
EOF
|
||||
|
||||
failed=0
|
||||
failed_files=""
|
||||
|
||||
for file in ${{ steps.dokcer_files.outputs.found_files }}; do
|
||||
echo "::group::${file}"
|
||||
docker run --rm -i \
|
||||
-e "NO_COLOR=0" \
|
||||
-e "HADOLINT_VERBOSE=1" \
|
||||
-v $(pwd)/.hadolint.yaml:/.config/hadolint.yaml \
|
||||
hadolint/hadolint < $file || {
|
||||
failed=1
|
||||
failed_files="$failed_files $file"
|
||||
}
|
||||
echo "::endgroup::"
|
||||
done
|
||||
|
||||
if [ $failed -ne 0 ]; then
|
||||
echo "::error:: hadolint failed for the following files: $failed_files"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Python - flake8
|
||||
if: always()
|
||||
run: |
|
||||
python -m flake8 \
|
||||
--color=always \
|
||||
--verbose
|
||||
|
||||
- name: Python - nbqa flake8
|
||||
if: always()
|
||||
run: |
|
||||
python -m nbqa flake8 \
|
||||
--color=always \
|
||||
--verbose \
|
||||
.
|
||||
|
||||
- name: Python - nb-clean
|
||||
if: always()
|
||||
run: |
|
||||
output=$(find . -name '*.ipynb' -exec nb-clean check {} \;)
|
||||
|
||||
# fail if there are any issues
|
||||
if [ -n "$output" ]; then
|
||||
echo "$output"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Rust - find Cargo.toml
|
||||
id: run_cargo
|
||||
if: always()
|
||||
run: |
|
||||
# check if Cargo.toml exists
|
||||
if [ -f "Cargo.toml" ]; then
|
||||
echo "found_cargo=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "found_cargo=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Rust - setup toolchain
|
||||
if: always() && steps.run_cargo.outputs.found_cargo == 'true'
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
components: rustfmt
|
||||
|
||||
- name: Rust - cargo fmt
|
||||
if: always() && steps.run_cargo.outputs.found_cargo == 'true'
|
||||
run: |
|
||||
cargo fmt -- --check
|
||||
|
||||
- name: YAML - find files
|
||||
id: yaml_files
|
||||
if: always()
|
||||
run: |
|
||||
# space separated list of files
|
||||
FILES=.clang-format
|
||||
|
||||
# empty placeholder
|
||||
found_files=""
|
||||
|
||||
for FILE in ${FILES}; do
|
||||
if [ -f "$FILE" ]
|
||||
then
|
||||
found_files="$found_files $FILE"
|
||||
fi
|
||||
done
|
||||
|
||||
echo "found_files=${found_files}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: YAML - yamllint
|
||||
id: yamllint
|
||||
if: always()
|
||||
uses: ibiqlik/action-yamllint@v3
|
||||
with:
|
||||
# https://yamllint.readthedocs.io/en/stable/configuration.html#default-configuration
|
||||
config_data: |
|
||||
extends: default
|
||||
rules:
|
||||
comments:
|
||||
level: error
|
||||
document-start:
|
||||
level: error
|
||||
line-length:
|
||||
max: 120
|
||||
new-line-at-end-of-file:
|
||||
level: error
|
||||
new-lines:
|
||||
type: unix
|
||||
truthy:
|
||||
# GitHub uses "on" for workflow event triggers
|
||||
# .clang-format file has options of "Yes" "No" that will be caught by this, so changed to "warning"
|
||||
allowed-values: ['true', 'false', 'on']
|
||||
check-keys: true
|
||||
level: warning
|
||||
file_or_dir: . ${{ steps.yaml_files.outputs.found_files }}
|
||||
|
||||
- name: YAML - log
|
||||
if: always() && steps.yamllint.outcome == 'failure'
|
||||
run: cat "${{ steps.yamllint.outputs.logfile }}" >> $GITHUB_STEP_SUMMARY
|
||||
30
.github/workflows/issues.yml
vendored
30
.github/workflows/issues.yml
vendored
@@ -1,30 +0,0 @@
|
||||
---
|
||||
# This workflow is centrally managed in https://github.com/<organization>/.github/
|
||||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||
# the above-mentioned repo.
|
||||
|
||||
# Label and un-label actions using `../label-actions.yml`.
|
||||
|
||||
name: Issues
|
||||
permissions: {}
|
||||
|
||||
on:
|
||||
issues:
|
||||
types:
|
||||
- labeled
|
||||
- unlabeled
|
||||
discussion:
|
||||
types:
|
||||
- labeled
|
||||
- unlabeled
|
||||
|
||||
jobs:
|
||||
label:
|
||||
name: Label Actions
|
||||
if: startsWith(github.repository, 'LizardByte/')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Label Actions
|
||||
uses: dessant/label-actions@v4
|
||||
with:
|
||||
github-token: ${{ secrets.GH_BOT_TOKEN }}
|
||||
8
.github/workflows/localize.yml
vendored
8
.github/workflows/localize.yml
vendored
@@ -48,9 +48,9 @@ jobs:
|
||||
if [ -f "${{ env.file }}" ];
|
||||
then
|
||||
rm ${{ env.file }}
|
||||
echo "new_file=false" >> $GITHUB_ENV
|
||||
echo "new_file=false" >> "${GITHUB_ENV}"
|
||||
else
|
||||
echo "new_file=true" >> $GITHUB_ENV
|
||||
echo "new_file=true" >> "${GITHUB_ENV}"
|
||||
fi
|
||||
|
||||
# extract the new strings
|
||||
@@ -67,7 +67,7 @@ jobs:
|
||||
|
||||
# set the variable with minimal output, replacing `\t` with ` `
|
||||
OUTPUT=$(git diff --numstat locale/sunshine.po | sed -e "s#\t# #g")
|
||||
echo "git_diff=${OUTPUT}" >> $GITHUB_ENV
|
||||
echo "git_diff=${OUTPUT}" >> "${GITHUB_ENV}"
|
||||
|
||||
- name: git reset
|
||||
# only run if a single line changed (date/time) and file already existed
|
||||
@@ -79,7 +79,7 @@ jobs:
|
||||
|
||||
- name: Get current date
|
||||
id: date
|
||||
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
|
||||
run: echo "date=$(date +'%Y-%m-%d')" >> "${GITHUB_OUTPUT}"
|
||||
|
||||
- name: Create/Update Pull Request
|
||||
uses: peter-evans/create-pull-request@v7
|
||||
|
||||
137
.github/workflows/release-notifier.yml
vendored
137
.github/workflows/release-notifier.yml
vendored
@@ -1,137 +0,0 @@
|
||||
---
|
||||
# This workflow is centrally managed in https://github.com/<organization>/.github/
|
||||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||
# the above-mentioned repo.
|
||||
|
||||
# Create a blog post for a new release and open a PR to the blog repo
|
||||
|
||||
name: Release Notifications
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- released # this triggers when a release is published, but does not include pre-releases or drafts
|
||||
|
||||
jobs:
|
||||
update-blog:
|
||||
name: Update blog
|
||||
if: github.repository_owner == 'LizardByte'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check topics
|
||||
env:
|
||||
TOPIC: replicator-release-notifications
|
||||
id: check-label
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const topic = process.env.TOPIC;
|
||||
console.log(`Checking if repo has topic: ${topic}`);
|
||||
|
||||
const repoTopics = await github.rest.repos.getAllTopics({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo
|
||||
});
|
||||
console.log(`Repo topics: ${repoTopics.data.names}`);
|
||||
|
||||
const hasTopic = repoTopics.data.names.includes(topic);
|
||||
console.log(`Has topic: ${hasTopic}`);
|
||||
|
||||
core.setOutput('hasTopic', hasTopic);
|
||||
|
||||
- name: Check if latest GitHub release
|
||||
id: check-release
|
||||
if: steps.check-label.outputs.hasTopic == 'true'
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const latestRelease = await github.rest.repos.getLatestRelease({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo
|
||||
});
|
||||
|
||||
core.setOutput('isLatestRelease', latestRelease.data.tag_name === context.payload.release.tag_name);
|
||||
|
||||
- name: Checkout blog
|
||||
if: >-
|
||||
steps.check-label.outputs.hasTopic == 'true' &&
|
||||
steps.check-release.outputs.isLatestRelease == 'true'
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: "LizardByte/LizardByte.github.io"
|
||||
|
||||
- name: Create blog post
|
||||
if: >-
|
||||
steps.check-label.outputs.hasTopic == 'true' &&
|
||||
steps.check-release.outputs.isLatestRelease == 'true'
|
||||
run: |
|
||||
# setup variables
|
||||
tag_name="${{ github.event.release.tag_name }}"
|
||||
semver="${tag_name#v}"
|
||||
repo_lower="$(echo "${{ github.event.repository.name }}" | tr '[:upper:]' '[:lower:]')"
|
||||
|
||||
# extract year, month, and day
|
||||
year="${semver%%.*}"
|
||||
month_day="${semver#*.}"
|
||||
month_day="${month_day%%.*}"
|
||||
|
||||
# ensure month_day is 4 digits
|
||||
month_day=$(printf "%04d" "$month_day")
|
||||
|
||||
# create the filename
|
||||
file_name="_posts/releases/${repo_lower}/${year}-${month_day:0:2}-${month_day:2:2}-v${semver}.md"
|
||||
mkdir -p "$(dirname "${file_name}")"
|
||||
|
||||
# create jekyll blog post
|
||||
echo "---" > "${file_name}"
|
||||
echo "layout: release" >> "${file_name}"
|
||||
echo "title: ${{ github.event.repository.name }} ${tag_name} Released" >> "${file_name}"
|
||||
echo "release-tag: ${tag_name}" >> "${file_name}"
|
||||
echo "gh-repo: ${{ github.repository }}" >> "${file_name}"
|
||||
echo "gh-badge: [follow, fork, star]" >> "${file_name}"
|
||||
echo "tags: [release, ${repo_lower}]" >> "${file_name}"
|
||||
echo "comments: true" >> "${file_name}"
|
||||
echo "author: LizardByte-bot" >> "${file_name}"
|
||||
echo "---" >> "${file_name}"
|
||||
echo "" >> "${file_name}"
|
||||
|
||||
release_body=$(cat <<EOF
|
||||
${{ github.event.release.body }}
|
||||
EOF
|
||||
)
|
||||
|
||||
echo "${release_body}" >> "${file_name}"
|
||||
|
||||
- name: Create/Update Pull Request
|
||||
id: create-pr
|
||||
if: >-
|
||||
steps.check-label.outputs.hasTopic == 'true' &&
|
||||
steps.check-release.outputs.isLatestRelease == 'true'
|
||||
uses: peter-evans/create-pull-request@v7
|
||||
with:
|
||||
token: ${{ secrets.GH_BOT_TOKEN }}
|
||||
commit-message: |
|
||||
chore: Add blog post for ${{ github.event.repository.name }} release ${{ github.event.release.tag_name }}
|
||||
branch: bot/add-${{ github.event.repository.name }}-${{ github.event.release.tag_name }}
|
||||
delete-branch: true
|
||||
title: |
|
||||
chore: Add blog post for ${{ github.event.repository.name }} release ${{ github.event.release.tag_name }}
|
||||
body: ${{ github.event.release.body }}
|
||||
labels:
|
||||
blog
|
||||
|
||||
- name: Automerge PR
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
|
||||
if: >-
|
||||
steps.check-label.outputs.hasTopic == 'true' &&
|
||||
steps.check-release.outputs.isLatestRelease == 'true'
|
||||
run: |
|
||||
gh pr merge \
|
||||
--auto \
|
||||
--delete-branch \
|
||||
--repo "LizardByte/LizardByte.github.io" \
|
||||
--squash \
|
||||
"${{ steps.create-pr.outputs.pull-request-number }}"
|
||||
99
.github/workflows/update-docs.yml
vendored
99
.github/workflows/update-docs.yml
vendored
@@ -1,99 +0,0 @@
|
||||
---
|
||||
# This workflow is centrally managed in https://github.com/<organization>/.github/
|
||||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||
# the above-mentioned repo.
|
||||
|
||||
# To use, add the `rtd` repository label to identify repositories that should trigger this workflow.
|
||||
# If the project slug is not the repository name, add a repository variable named `READTHEDOCS_SLUG` with the value of
|
||||
# the ReadTheDocs project slug.
|
||||
|
||||
# Update readthedocs on release events.
|
||||
|
||||
name: Update docs
|
||||
permissions: {}
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- created
|
||||
- edited
|
||||
- deleted
|
||||
|
||||
concurrency:
|
||||
group: "${{ github.workflow }}-${{ github.event.release.tag_name }}"
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
update-docs:
|
||||
env:
|
||||
RTD_SLUG: ${{ vars.READTHEDOCS_SLUG }}
|
||||
RTD_TOKEN: ${{ secrets.READTHEDOCS_TOKEN }}
|
||||
TAG: ${{ github.event.release.tag_name }}
|
||||
if: >-
|
||||
!github.event.release.draft
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Get RTD_SLUG
|
||||
run: |
|
||||
# if the RTD_SLUG is not set, use the repository name in lowercase
|
||||
if [ -z "${RTD_SLUG}" ]; then
|
||||
RTD_SLUG=$(echo "${{ github.event.repository.name }}" | tr '[:upper:]' '[:lower:]')
|
||||
fi
|
||||
echo "RTD_SLUG=${RTD_SLUG}" >> $GITHUB_ENV
|
||||
|
||||
- name: Deactivate deleted release
|
||||
if: >-
|
||||
github.event_name == 'release' &&
|
||||
github.event.action == 'deleted'
|
||||
run: |
|
||||
json_body=$(jq -n \
|
||||
--arg active "false" \
|
||||
--arg hidden "false" \
|
||||
--arg privacy_level "public" \
|
||||
'{active: $active, hidden: $hidden, privacy_level: $privacy_level}')
|
||||
|
||||
curl \
|
||||
-X PATCH \
|
||||
-H "Authorization: Token ${RTD_TOKEN}" \
|
||||
https://readthedocs.org/api/v3/projects/${RTD_SLUG}/versions/${TAG}/ \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "$json_body"
|
||||
|
||||
- name: Check if edited release is latest GitHub release
|
||||
id: check
|
||||
if: >-
|
||||
github.event_name == 'release' &&
|
||||
github.event.action == 'edited'
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const latestRelease = await github.rest.repos.getLatestRelease({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo
|
||||
});
|
||||
|
||||
core.setOutput('isLatestRelease', latestRelease.data.tag_name === context.payload.release.tag_name);
|
||||
|
||||
- name: Update RTD project
|
||||
# changing the default branch in readthedocs makes "latest" point to that branch/tag
|
||||
# we can also update other properties like description, etc.
|
||||
if: steps.check.outputs.isLatestRelease == 'true'
|
||||
run: |
|
||||
json_body=$(jq -n \
|
||||
--arg default_branch "${TAG}" \
|
||||
--arg description "${{ github.event.repository.description }}" \
|
||||
'{default_branch: $default_branch}')
|
||||
|
||||
# change the default branch to the latest release
|
||||
curl \
|
||||
-X PATCH \
|
||||
-H "Authorization: Token ${RTD_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
https://readthedocs.org/api/v3/projects/${RTD_SLUG}/ \
|
||||
-d "$json_body"
|
||||
|
||||
# trigger a build for the latest version
|
||||
curl \
|
||||
-X POST \
|
||||
-H "Authorization: Token ${RTD_TOKEN}" \
|
||||
https://readthedocs.org/api/v3/projects/${RTD_SLUG}/versions/latest/builds/
|
||||
206
.github/workflows/update-flathub-repo.yml
vendored
206
.github/workflows/update-flathub-repo.yml
vendored
@@ -1,206 +0,0 @@
|
||||
---
|
||||
# This workflow is centrally managed in https://github.com/<organization>/.github/
|
||||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||
# the above-mentioned repo.
|
||||
|
||||
# To use, add the `flathub-pkg` repository label to identify repositories that should trigger this workflow.
|
||||
|
||||
# Update Flathub on release events.
|
||||
|
||||
name: Update flathub repo
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- released
|
||||
|
||||
concurrency:
|
||||
group: "${{ github.workflow }}-${{ github.event.release.tag_name }}"
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
update-flathub-repo:
|
||||
env:
|
||||
FLATHUB_PKG: dev.lizardbyte.app.${{ github.event.repository.name }}
|
||||
if: github.repository_owner == 'LizardByte'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check if flathub repo
|
||||
id: check-label
|
||||
env:
|
||||
TOPIC: flathub-pkg
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const topic = process.env.TOPIC;
|
||||
console.log(`Checking if repo has topic: ${topic}`);
|
||||
|
||||
const repoTopics = await github.rest.repos.getAllTopics({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo
|
||||
});
|
||||
console.log(`Repo topics: ${repoTopics.data.names}`);
|
||||
|
||||
const hasTopic = repoTopics.data.names.includes(topic);
|
||||
console.log(`Has topic: ${hasTopic}`);
|
||||
|
||||
core.setOutput('hasTopic', hasTopic);
|
||||
|
||||
- name: Check if latest GitHub release
|
||||
id: check-release
|
||||
if: steps.check-label.outputs.hasTopic == 'true'
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const latestRelease = await github.rest.repos.getLatestRelease({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo
|
||||
});
|
||||
|
||||
core.setOutput('isLatestRelease', latestRelease.data.tag_name === context.payload.release.tag_name);
|
||||
|
||||
- name: Checkout
|
||||
if: >-
|
||||
steps.check-label.outputs.hasTopic == 'true' &&
|
||||
steps.check-release.outputs.isLatestRelease == 'true'
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Checkout flathub-repo
|
||||
if: >-
|
||||
steps.check-label.outputs.hasTopic == 'true' &&
|
||||
steps.check-release.outputs.isLatestRelease == 'true'
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: "flathub/${{ env.FLATHUB_PKG }}"
|
||||
path: "flathub/${{ env.FLATHUB_PKG }}"
|
||||
|
||||
- name: Clean up legacy files
|
||||
if: >-
|
||||
steps.check-label.outputs.hasTopic == 'true' &&
|
||||
steps.check-release.outputs.isLatestRelease == 'true'
|
||||
working-directory: flathub/${{ env.FLATHUB_PKG }}
|
||||
run: |
|
||||
rm -rf ./*
|
||||
|
||||
- name: Copy github files
|
||||
if: >-
|
||||
steps.check-label.outputs.hasTopic == 'true' &&
|
||||
steps.check-release.outputs.isLatestRelease == 'true'
|
||||
working-directory: flathub/${{ env.FLATHUB_PKG }}
|
||||
run: |
|
||||
mkdir -p .github/ISSUE_TEMPLATE
|
||||
|
||||
# sponsors
|
||||
curl -sSL https://github.com/LizardByte/.github/raw/refs/heads/master/.github/FUNDING.yml \
|
||||
-o .github/FUNDING.yml
|
||||
# pull request template
|
||||
curl -sSL https://github.com/LizardByte/.github/raw/refs/heads/master/.github/pull_request_template.md \
|
||||
-o .github/pull_request_template.md
|
||||
# issue config
|
||||
curl -sSL https://github.com/LizardByte/.github/raw/refs/heads/master/.github/ISSUE_TEMPLATE/config.yml \
|
||||
-o .github/ISSUE_TEMPLATE/config.yml
|
||||
|
||||
- name: Download release asset
|
||||
id: download
|
||||
if: >-
|
||||
steps.check-label.outputs.hasTopic == 'true' &&
|
||||
steps.check-release.outputs.isLatestRelease == 'true'
|
||||
uses: robinraju/release-downloader@v1.12
|
||||
with:
|
||||
repository: "${{ github.repository }}"
|
||||
tag: "${{ github.event.release.tag_name }}"
|
||||
fileName: "flathub.tar.gz"
|
||||
tarBall: false
|
||||
zipBall: false
|
||||
out-file-path: "flathub/${{ env.FLATHUB_PKG }}"
|
||||
extract: true
|
||||
|
||||
- name: Delete archive
|
||||
if: >-
|
||||
steps.check-label.outputs.hasTopic == 'true' &&
|
||||
steps.check-release.outputs.isLatestRelease == 'true'
|
||||
run: |
|
||||
rm -f flathub/${{ env.FLATHUB_PKG }}/flathub.tar.gz
|
||||
|
||||
- name: Update metainfo.xml
|
||||
id: update_metainfo
|
||||
if: >-
|
||||
steps.check-label.outputs.hasTopic == 'true' &&
|
||||
steps.check-release.outputs.isLatestRelease == 'true'
|
||||
run: |
|
||||
xml_file="flathub/${{ env.FLATHUB_PKG }}/${{ env.FLATHUB_PKG }}.metainfo.xml"
|
||||
|
||||
# Extract release information
|
||||
version="${{ github.event.release.tag_name }}" && version="${version#v}"
|
||||
date="${{ github.event.release.published_at }}" && date="${date%%T*}"
|
||||
changelog="${{ github.event.release.body }}" && changelog="${changelog//&/&}" && \
|
||||
changelog="${changelog//</<}" && changelog="${changelog//>/>}"
|
||||
|
||||
# Store the old release information into a temp file to be used for precise replacement
|
||||
tmpfile=$(mktemp)
|
||||
|
||||
# Match the existing <release> block, replace it with the new data
|
||||
awk -v version="$version" -v date="$date" -v changelog="$changelog" '
|
||||
BEGIN { replaced = 0 }
|
||||
/<release version=.*>/ {
|
||||
if (!replaced) {
|
||||
print " <release version=\"" version "\" date=\"" date "\">"
|
||||
print " <description><p>" changelog "</p></description>"
|
||||
print " </release>"
|
||||
replaced = 1
|
||||
}
|
||||
}
|
||||
!/<release version=.*>/ && !/<\/release>/ { print $0 }
|
||||
' "$xml_file" > "$tmpfile"
|
||||
|
||||
# Move the updated file back to the original location
|
||||
mv "$tmpfile" "$xml_file"
|
||||
|
||||
- name: Update submodule
|
||||
if: >-
|
||||
steps.check-label.outputs.hasTopic == 'true' &&
|
||||
steps.check-release.outputs.isLatestRelease == 'true'
|
||||
run: |
|
||||
# Get the current commit of the submodule in the main repository
|
||||
git submodule update --init packaging/linux/flatpak/deps/shared-modules
|
||||
cd ${{ github.workspace }}/packaging/linux/flatpak/deps/shared-modules
|
||||
main_commit=$(git rev-parse HEAD)
|
||||
|
||||
# update submodules
|
||||
cd ${{ github.workspace }}/flathub/${{ env.FLATHUB_PKG }}
|
||||
git submodule update --init shared-modules
|
||||
cd shared-modules
|
||||
git checkout $main_commit
|
||||
|
||||
- name: Create/Update Pull Request
|
||||
id: create-pr
|
||||
if: >-
|
||||
steps.check-label.outputs.hasTopic == 'true' &&
|
||||
steps.check-release.outputs.isLatestRelease == 'true' &&
|
||||
fromJson(steps.download.outputs.downloaded_files)[0]
|
||||
uses: peter-evans/create-pull-request@v7
|
||||
with:
|
||||
path: "flathub/${{ env.FLATHUB_PKG }}"
|
||||
token: ${{ secrets.GH_BOT_TOKEN }}
|
||||
commit-message: "chore: Update ${{ env.FLATHUB_PKG }} to ${{ github.event.release.tag_name }}"
|
||||
branch: bot/bump-${{ env.FLATHUB_PKG }}-${{ github.event.release.tag_name }}
|
||||
delete-branch: true
|
||||
title: "chore: Update ${{ env.FLATHUB_PKG }} to ${{ github.event.release.tag_name }}"
|
||||
body: ${{ github.event.release.body }}
|
||||
|
||||
- name: Automerge PR
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
|
||||
if: >-
|
||||
steps.check-label.outputs.hasTopic == 'true' &&
|
||||
steps.check-release.outputs.isLatestRelease == 'true' &&
|
||||
fromJson(steps.download.outputs.downloaded_files)[0]
|
||||
run: |
|
||||
gh pr merge \
|
||||
--auto \
|
||||
--delete-branch \
|
||||
--repo "flathub/${{ env.FLATHUB_PKG }}" \
|
||||
--squash \
|
||||
"${{ steps.create-pr.outputs.pull-request-number }}"
|
||||
73
.github/workflows/update-homebrew-release.yml
vendored
73
.github/workflows/update-homebrew-release.yml
vendored
@@ -1,73 +0,0 @@
|
||||
---
|
||||
# This workflow is centrally managed in https://github.com/<organization>/.github/
|
||||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||
# the above-mentioned repo.
|
||||
|
||||
# To use, add the `homebrew-pkg` repository label to identify repositories that should trigger this workflow.
|
||||
|
||||
# Update Homebrew on release events.
|
||||
|
||||
name: Update Homebrew release
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- released
|
||||
|
||||
concurrency:
|
||||
group: "${{ github.workflow }}-${{ github.event.release.tag_name }}"
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
update-homebrew-release:
|
||||
if: github.repository_owner == 'LizardByte'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check if Homebrew repo
|
||||
id: check-label
|
||||
env:
|
||||
TOPIC: homebrew-pkg
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const topic = process.env.TOPIC;
|
||||
console.log(`Checking if repo has topic: ${topic}`);
|
||||
|
||||
const repoTopics = await github.rest.repos.getAllTopics({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo
|
||||
});
|
||||
console.log(`Repo topics: ${repoTopics.data.names}`);
|
||||
|
||||
const hasTopic = repoTopics.data.names.includes(topic);
|
||||
console.log(`Has topic: ${hasTopic}`);
|
||||
|
||||
core.setOutput('hasTopic', hasTopic);
|
||||
|
||||
- name: Download release asset
|
||||
id: download
|
||||
if: steps.check-label.outputs.hasTopic == 'true'
|
||||
uses: robinraju/release-downloader@v1.12
|
||||
with:
|
||||
repository: "${{ github.repository }}"
|
||||
tag: "${{ github.event.release.tag_name }}"
|
||||
fileName: "*.rb"
|
||||
tarBall: false
|
||||
zipBall: false
|
||||
out-file-path: "release_downloads"
|
||||
extract: false
|
||||
|
||||
- name: Publish Homebrew Formula
|
||||
if: >-
|
||||
steps.check-label.outputs.hasTopic == 'true' &&
|
||||
fromJson(steps.download.outputs.downloaded_files)[0]
|
||||
uses: LizardByte/homebrew-release-action@v2024.1115.14934
|
||||
with:
|
||||
formula_file: ${{ fromJson(steps.download.outputs.downloaded_files)[0] }}
|
||||
git_email: ${{ secrets.GH_BOT_EMAIL }}
|
||||
git_username: ${{ secrets.GH_BOT_NAME }}
|
||||
publish: true
|
||||
token: ${{ secrets.GH_BOT_TOKEN }}
|
||||
validate: false
|
||||
134
.github/workflows/update-pacman-repo.yml
vendored
134
.github/workflows/update-pacman-repo.yml
vendored
@@ -1,134 +0,0 @@
|
||||
---
|
||||
# This workflow is centrally managed in https://github.com/<organization>/.github/
|
||||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||
# the above-mentioned repo.
|
||||
|
||||
# To use, add the `pacman-pkg` repository label to identify repositories that should trigger this workflow.
|
||||
|
||||
# Update pacman repo on release events.
|
||||
|
||||
name: Update pacman repo
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- released
|
||||
|
||||
concurrency:
|
||||
group: "${{ github.workflow }}-${{ github.event.release.tag_name }}"
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
update-homebrew-release:
|
||||
if: github.repository_owner == 'LizardByte'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check if pacman repo
|
||||
id: check-label
|
||||
env:
|
||||
TOPIC: pacman-pkg
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const topic = process.env.TOPIC;
|
||||
console.log(`Checking if repo has topic: ${topic}`);
|
||||
|
||||
const repoTopics = await github.rest.repos.getAllTopics({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo
|
||||
});
|
||||
console.log(`Repo topics: ${repoTopics.data.names}`);
|
||||
|
||||
const hasTopic = repoTopics.data.names.includes(topic);
|
||||
console.log(`Has topic: ${hasTopic}`);
|
||||
|
||||
core.setOutput('hasTopic', hasTopic);
|
||||
|
||||
- name: Check if latest GitHub release
|
||||
id: check-release
|
||||
if: >-
|
||||
steps.check-label.outputs.hasTopic == 'true'
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const latestRelease = await github.rest.repos.getLatestRelease({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo
|
||||
});
|
||||
|
||||
core.setOutput('isLatestRelease', latestRelease.data.tag_name === context.payload.release.tag_name);
|
||||
|
||||
- name: Checkout pacman-repo
|
||||
if: >-
|
||||
steps.check-label.outputs.hasTopic == 'true' &&
|
||||
steps.check-release.outputs.isLatestRelease == 'true'
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: ${{ github.repository_owner }}/pacman-repo
|
||||
|
||||
- name: Prep
|
||||
id: prep
|
||||
if: >-
|
||||
steps.check-label.outputs.hasTopic == 'true' &&
|
||||
steps.check-release.outputs.isLatestRelease == 'true'
|
||||
run: |
|
||||
echo "pkg_name=$(echo ${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Download release asset
|
||||
id: download
|
||||
if: >-
|
||||
steps.check-label.outputs.hasTopic == 'true' &&
|
||||
steps.check-release.outputs.isLatestRelease == 'true'
|
||||
uses: robinraju/release-downloader@v1.12
|
||||
with:
|
||||
repository: "${{ github.repository }}"
|
||||
tag: "${{ github.event.release.tag_name }}"
|
||||
fileName: "*.pkg.tar.gz"
|
||||
tarBall: false
|
||||
zipBall: false
|
||||
out-file-path: "pkgbuilds/${{ steps.prep.outputs.pkg_name }}"
|
||||
extract: true
|
||||
|
||||
- name: Remove pkg.tar.gz
|
||||
if: >-
|
||||
steps.check-label.outputs.hasTopic == 'true' &&
|
||||
steps.check-release.outputs.isLatestRelease == 'true' &&
|
||||
fromJson(steps.download.outputs.downloaded_files)[0]
|
||||
run: |
|
||||
rm -f "pkgbuilds/${{ steps.prep.outputs.pkg_name }}"
|
||||
|
||||
- name: Create/Update Pull Request
|
||||
id: create-pr
|
||||
if: >-
|
||||
steps.check-label.outputs.hasTopic == 'true' &&
|
||||
steps.check-release.outputs.isLatestRelease == 'true' &&
|
||||
fromJson(steps.download.outputs.downloaded_files)[0]
|
||||
uses: peter-evans/create-pull-request@v7
|
||||
with:
|
||||
add-paths: |
|
||||
pkgbuilds/*
|
||||
token: ${{ secrets.GH_BOT_TOKEN }}
|
||||
commit-message: "chore: Update ${{ github.repository }} to ${{ github.event.release.tag_name }}"
|
||||
branch: bot/bump-${{ github.repository }}-${{ github.event.release.tag_name }}
|
||||
delete-branch: true
|
||||
title: "chore: Update ${{ github.repository }} to ${{ github.event.release.tag_name }}"
|
||||
body: ${{ github.event.release.body }}
|
||||
labels: |
|
||||
auto-approve
|
||||
auto-merge
|
||||
|
||||
- name: Automerge PR
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
|
||||
if: >-
|
||||
steps.check-label.outputs.hasTopic == 'true' &&
|
||||
steps.check-release.outputs.isLatestRelease == 'true' &&
|
||||
fromJson(steps.download.outputs.downloaded_files)[0]
|
||||
run: |
|
||||
gh pr merge \
|
||||
--auto \
|
||||
--delete-branch \
|
||||
--squash \
|
||||
"${{ steps.create-pr.outputs.pull-request-number }}"
|
||||
71
.github/workflows/update-winget-release.yml
vendored
71
.github/workflows/update-winget-release.yml
vendored
@@ -1,71 +0,0 @@
|
||||
---
|
||||
# This workflow is centrally managed in https://github.com/<organization>/.github/
|
||||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||
# the above-mentioned repo.
|
||||
|
||||
# To use, add the `winget-pkg` repository label to identify repositories that should trigger this workflow.
|
||||
|
||||
# Update Winget on release events.
|
||||
|
||||
name: Update Winget release
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- released
|
||||
|
||||
concurrency:
|
||||
group: "${{ github.workflow }}-${{ github.event.release.tag_name }}"
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
update-winget-release:
|
||||
if: github.repository_owner == 'LizardByte'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check if Winget repo
|
||||
id: check-label
|
||||
env:
|
||||
TOPIC: winget-pkg
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const topic = process.env.TOPIC;
|
||||
console.log(`Checking if repo has topic: ${topic}`);
|
||||
|
||||
const repoTopics = await github.rest.repos.getAllTopics({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo
|
||||
});
|
||||
console.log(`Repo topics: ${repoTopics.data.names}`);
|
||||
|
||||
const hasTopic = repoTopics.data.names.includes(topic);
|
||||
console.log(`Has topic: ${hasTopic}`);
|
||||
|
||||
core.setOutput('hasTopic', hasTopic);
|
||||
|
||||
- name: Download release asset
|
||||
id: download
|
||||
if: steps.check-label.outputs.hasTopic == 'true'
|
||||
uses: robinraju/release-downloader@v1.12
|
||||
with:
|
||||
repository: "${{ github.repository }}"
|
||||
tag: "${{ github.event.release.tag_name }}"
|
||||
fileName: "*.exe"
|
||||
tarBall: false
|
||||
zipBall: false
|
||||
out-file-path: "release_downloads"
|
||||
extract: false
|
||||
|
||||
- name: Release to WinGet
|
||||
if: >-
|
||||
steps.check-label.outputs.hasTopic == 'true' &&
|
||||
fromJson(steps.download.outputs.downloaded_files)[0]
|
||||
uses: vedantmgoyal2009/winget-releaser@v2
|
||||
with:
|
||||
identifier: "${{ github.repository_owner }}.${{ github.event.repository.name }}"
|
||||
release-tag: ${{ github.event.release.tag_name }}
|
||||
installers-regex: '\.exe$'
|
||||
token: ${{ secrets.GH_BOT_TOKEN }}
|
||||
@@ -27,6 +27,9 @@ endif()
|
||||
# set the module path, used for includes
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
|
||||
|
||||
# export compile_commands.json
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
# set version info for this build
|
||||
include(${CMAKE_MODULE_PATH}/prep/build_version.cmake)
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<a href="https://flathub.org/apps/dev.lizardbyte.app.Sunshine"><img src="https://img.shields.io/flathub/v/dev.lizardbyte.app.Sunshine?style=for-the-badge&logo=flathub" alt="Flathub Version"></a>
|
||||
<a href="https://github.com/microsoft/winget-pkgs/tree/master/manifests/l/LizardByte/Sunshine"><img src="https://img.shields.io/winget/v/LizardByte.Sunshine?style=for-the-badge&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHuSURBVFhH7ZfNTtRQGIYZiMDwN/IrCAqIhMSNKxcmymVwG+5dcDVsWHgDrtxwCYQVl+BChzDEwSnPY+eQ0sxoOz1mQuBNnpyvTdvz9jun5/SrjfxnJUkyQbMEz2ELduF1l0YUA3QyTrMAa2AnPtyOXsELeAYNyKtV2EC3k3lYgTOwg09ghy/BTp7CKBRV844BOpmmMV2+ySb4BmInG7AKY7AHH+EYqqhZo9PPBG/BVDlOizAD/XQFmnoPXzxRQX8M/CCYS48L6RIc4ygGHK9WGg9HZSZMUNRPVwNJGg5Hg2Qgqh4N3FsDsb6EmgYm07iwwvUxstdxJTwgmILf4CfZ6bb5OHANX8GN5x20IVxnG8ge94pt2xpwU3GnCwayF4Q2G2vgFLzHndFzQdk4q77nNfCdwL28qNyMtmEf3A1/QV5FjDiPWo5jrwf8TWZChTlgJvL4F9QL50/A43qVidTvLcuoM2wDQ1+IkgefgUpLcYwMVBqCKNJA2b0gKNocOIITOIef8C/F/CdMbh/GklynsSawKLHS8d9/B1x2LUqsfFyy3TMsWj5A1cLkotDbYO4JjWWZlZEGv8EbOIR1CAVN2eG8W5oNKgxaeC6DmTJjZs7ixUxpznLPLT+v4sXpoMLcLI3mzFSonDXIEI/M3QCIO4YuimBJ/gAAAABJRU5ErkJggg==" alt="Winget Version"></a>
|
||||
<a href="https://gurubase.io/g/sunshine"><img src="https://img.shields.io/badge/Gurubase-Ask%20Guru-ef1a1b?style=for-the-badge&logo=data:image/jpeg;base64,/9j/2wCEAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDIBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIABgAGAMBIgACEQEDEQH/xAGiAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgsQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+gEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoLEQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEAAhEDEQA/AOLqSO3mlilljido4QGkYDIQEgAn05IH41seFo7aS+uRKlrJci2Y2cd2QImlyOGyQPu7sA8ZxXapAlvpThbPRkv7nTQWhDoIZZRc/XaSAOmcZGOnFfP06XMr3P17F5iqE+Tl1uuvf9Lde55dRW74pit4r61EcdtFdG2U3kVqQY0lyeBgkD5duQOASawqykuV2O6jV9rTU0rXLNjf3Om3QubSXy5QCudoYEEYIIOQR7GnahqV3qk6zXk3mOqhFAUKqqOyqAAByeAKqUUXdrFezhz89lfv1+8KKKKRZ//Z" alt="Gurubase"></a>
|
||||
<a href="https://github.com/LizardByte/Sunshine/actions/workflows/CI.yml?query=branch%3Amaster"><img src="https://img.shields.io/github/actions/workflow/status/lizardbyte/sunshine/CI.yml.svg?branch=master&label=CI%20build&logo=github&style=for-the-badge" alt="GitHub Workflow Status (CI)"></a>
|
||||
<a href="https://github.com/LizardByte/Sunshine/actions/workflows/ci.yml?query=branch%3Amaster"><img src="https://img.shields.io/github/actions/workflow/status/lizardbyte/sunshine/ci.yml.svg?branch=master&label=CI%20build&logo=github&style=for-the-badge" alt="GitHub Workflow Status (CI)"></a>
|
||||
<a href="https://github.com/LizardByte/Sunshine/actions/workflows/localize.yml?query=branch%3Amaster"><img src="https://img.shields.io/github/actions/workflow/status/lizardbyte/sunshine/localize.yml.svg?branch=master&label=localize%20build&logo=github&style=for-the-badge" alt="GitHub Workflow Status (localize)"></a>
|
||||
<a href="https://docs.lizardbyte.dev/projects/sunshine"><img src="https://img.shields.io/readthedocs/sunshinestream.svg?label=Docs&style=for-the-badge&logo=readthedocs" alt="Read the Docs"></a>
|
||||
<a href="https://codecov.io/gh/LizardByte/Sunshine"><img src="https://img.shields.io/codecov/c/gh/LizardByte/Sunshine?token=SMGXQ5NVMJ&style=for-the-badge&logo=codecov&label=codecov" alt="Codecov"></a>
|
||||
|
||||
@@ -52,9 +52,6 @@ include_directories(BEFORE SYSTEM "${CMAKE_SOURCE_DIR}/third-party/nv-codec-head
|
||||
file(GLOB NVENC_SOURCES CONFIGURE_DEPENDS "src/nvenc/*.cpp" "src/nvenc/*.h")
|
||||
list(APPEND PLATFORM_TARGET_FILES ${NVENC_SOURCES})
|
||||
|
||||
configure_file("${CMAKE_SOURCE_DIR}/src/version.h.in" version.h @ONLY)
|
||||
include_directories(BEFORE "${CMAKE_CURRENT_BINARY_DIR}") # required for importing version.h
|
||||
|
||||
set(SUNSHINE_TARGET_FILES
|
||||
"${CMAKE_SOURCE_DIR}/third-party/moonlight-common-c/src/Input.h"
|
||||
"${CMAKE_SOURCE_DIR}/third-party/moonlight-common-c/src/Rtsp.h"
|
||||
|
||||
@@ -85,18 +85,27 @@ if(CUDA_FOUND)
|
||||
add_compile_definitions(SUNSHINE_BUILD_CUDA)
|
||||
endif()
|
||||
|
||||
# drm
|
||||
if(${SUNSHINE_ENABLE_DRM})
|
||||
# libdrm is required for both DRM (KMS) and Wayland
|
||||
if(${SUNSHINE_ENABLE_DRM} OR ${SUNSHINE_ENABLE_WAYLAND})
|
||||
find_package(LIBDRM REQUIRED)
|
||||
find_package(LIBCAP REQUIRED)
|
||||
else()
|
||||
set(LIBDRM_FOUND OFF)
|
||||
endif()
|
||||
if(LIBDRM_FOUND)
|
||||
include_directories(SYSTEM ${LIBDRM_INCLUDE_DIRS})
|
||||
list(APPEND PLATFORM_LIBRARIES ${LIBDRM_LIBRARIES})
|
||||
endif()
|
||||
|
||||
# drm
|
||||
if(${SUNSHINE_ENABLE_DRM})
|
||||
find_package(LIBCAP REQUIRED)
|
||||
else()
|
||||
set(LIBCAP_FOUND OFF)
|
||||
endif()
|
||||
if(LIBDRM_FOUND AND LIBCAP_FOUND)
|
||||
add_compile_definitions(SUNSHINE_BUILD_DRM)
|
||||
include_directories(SYSTEM ${LIBDRM_INCLUDE_DIRS} ${LIBCAP_INCLUDE_DIRS})
|
||||
list(APPEND PLATFORM_LIBRARIES ${LIBDRM_LIBRARIES} ${LIBCAP_LIBRARIES})
|
||||
include_directories(SYSTEM ${LIBCAP_INCLUDE_DIRS})
|
||||
list(APPEND PLATFORM_LIBRARIES ${LIBCAP_LIBRARIES})
|
||||
list(APPEND PLATFORM_TARGET_FILES
|
||||
"${CMAKE_SOURCE_DIR}/src/platform/linux/kmsgrab.cpp")
|
||||
list(APPEND SUNSHINE_DEFINITIONS EGL_NO_X11=1)
|
||||
|
||||
@@ -38,10 +38,17 @@ if(NOT DEFINED SUNSHINE_ICON_PATH)
|
||||
set(SUNSHINE_ICON_PATH "${CMAKE_SOURCE_DIR}/sunshine.ico")
|
||||
endif()
|
||||
|
||||
configure_file("${CMAKE_SOURCE_DIR}/src/platform/windows/windows.rc.in" windows.rc @ONLY)
|
||||
# Create a separate object library for the RC file with minimal includes
|
||||
add_library(sunshine_rc_object OBJECT "${CMAKE_SOURCE_DIR}/src/platform/windows/windows.rc")
|
||||
|
||||
# Set minimal properties for RC compilation - only what's needed for the resource file
|
||||
# Otherwise compilation can fail due to "line too long" errors
|
||||
set_target_properties(sunshine_rc_object PROPERTIES
|
||||
COMPILE_DEFINITIONS "PROJECT_ICON_PATH=${SUNSHINE_ICON_PATH};PROJECT_NAME=${PROJECT_NAME};PROJECT_VENDOR=${SUNSHINE_PUBLISHER_NAME};PROJECT_VERSION=${PROJECT_VERSION};PROJECT_VERSION_MAJOR=${PROJECT_VERSION_MAJOR};PROJECT_VERSION_MINOR=${PROJECT_VERSION_MINOR};PROJECT_VERSION_PATCH=${PROJECT_VERSION_PATCH}" # cmake-lint: disable=C0301
|
||||
INCLUDE_DIRECTORIES ""
|
||||
)
|
||||
|
||||
set(PLATFORM_TARGET_FILES
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/windows.rc"
|
||||
"${CMAKE_SOURCE_DIR}/src/platform/windows/publish.cpp"
|
||||
"${CMAKE_SOURCE_DIR}/src/platform/windows/misc.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/platform/windows/misc.cpp"
|
||||
|
||||
@@ -3,7 +3,10 @@
|
||||
# common cpack options
|
||||
set(CPACK_PACKAGE_NAME ${CMAKE_PROJECT_NAME})
|
||||
set(CPACK_PACKAGE_VENDOR "LizardByte")
|
||||
string(REGEX REPLACE "^v" "" CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) # remove the v prefix if it exists
|
||||
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
|
||||
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
|
||||
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
|
||||
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
|
||||
set(CPACK_PACKAGE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/cpack_artifacts)
|
||||
set(CPACK_PACKAGE_CONTACT "https://app.lizardbyte.dev")
|
||||
set(CPACK_PACKAGE_DESCRIPTION ${CMAKE_PROJECT_DESCRIPTION})
|
||||
|
||||
@@ -45,6 +45,7 @@ set(CPACK_DEBIAN_PACKAGE_DEPENDS "\
|
||||
libcap2, \
|
||||
libcurl4, \
|
||||
libdrm2, \
|
||||
libgbm1, \
|
||||
libevdev2, \
|
||||
libnuma1, \
|
||||
libopus0, \
|
||||
@@ -65,6 +66,7 @@ set(CPACK_RPM_PACKAGE_REQUIRES "\
|
||||
libva >= 2.14.0, \
|
||||
libwayland-client >= 1.20.0, \
|
||||
libX11 >= 1.7.3.1, \
|
||||
mesa-libgbm >= 25.0.7, \
|
||||
miniupnpc >= 2.2.4, \
|
||||
numactl-libs >= 2.0.14, \
|
||||
openssl >= 3.0.2, \
|
||||
@@ -136,26 +138,13 @@ if(${SUNSHINE_TRAY} STREQUAL 1)
|
||||
endif()
|
||||
|
||||
# desktop file
|
||||
# todo - validate desktop files with `desktop-file-validate`
|
||||
if(NOT ${SUNSHINE_BUILD_FLATPAK})
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.desktop"
|
||||
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications")
|
||||
else()
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.desktop"
|
||||
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications"
|
||||
RENAME "${PROJECT_FQDN}.desktop")
|
||||
endif()
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_FQDN}.desktop"
|
||||
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications")
|
||||
if(NOT ${SUNSHINE_BUILD_APPIMAGE} AND NOT ${SUNSHINE_BUILD_FLATPAK})
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine_terminal.desktop"
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_FQDN}.terminal.desktop"
|
||||
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications")
|
||||
endif()
|
||||
|
||||
# metadata file
|
||||
# todo - validate file with `appstream-util validate-relax`
|
||||
if(NOT ${SUNSHINE_BUILD_FLATPAK})
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.appdata.xml"
|
||||
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo")
|
||||
else()
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_FQDN}.metainfo.xml"
|
||||
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo")
|
||||
endif()
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_FQDN}.metainfo.xml"
|
||||
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo")
|
||||
|
||||
@@ -1,11 +1,23 @@
|
||||
# windows specific packaging
|
||||
|
||||
# see options at: https://cmake.org/cmake/help/latest/cpack_gen/nsis.html
|
||||
install(TARGETS sunshine RUNTIME DESTINATION "." COMPONENT application)
|
||||
|
||||
# Hardening: include zlib1.dll (loaded via LoadLibrary() in openssl's libcrypto.a)
|
||||
install(FILES "${ZLIB}" DESTINATION "." COMPONENT application)
|
||||
|
||||
# ViGEmBus installer
|
||||
set(VIGEMBUS_INSTALLER "${CMAKE_BINARY_DIR}/vigembus_installer.exe")
|
||||
file(DOWNLOAD
|
||||
"https://github.com/nefarius/ViGEmBus/releases/download/v1.21.442.0/ViGEmBus_1.21.442_x64_x86_arm64.exe"
|
||||
${VIGEMBUS_INSTALLER}
|
||||
SHOW_PROGRESS
|
||||
EXPECTED_HASH SHA256=155c50f1eec07bdc28d2f61a3e3c2c6c132fee7328412de224695f89143316bc
|
||||
TIMEOUT 60
|
||||
)
|
||||
install(FILES ${VIGEMBUS_INSTALLER}
|
||||
DESTINATION "scripts"
|
||||
RENAME "vigembus_installer.exe"
|
||||
COMPONENT gamepad)
|
||||
|
||||
# Adding tools
|
||||
install(TARGETS dxgi-info RUNTIME DESTINATION "tools" COMPONENT dxgi)
|
||||
install(TARGETS audio-info RUNTIME DESTINATION "tools" COMPONENT audio)
|
||||
@@ -52,79 +64,11 @@ cmake_path(CONVERT "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/assets/shaders"
|
||||
cmake_path(CONVERT "${CMAKE_BINARY_DIR}/assets/shaders" TO_NATIVE_PATH_LIST shaders_in_build_dest_native)
|
||||
execute_process(COMMAND cmd.exe /c mklink /J "${shaders_in_build_dest_native}" "${shaders_in_build_src_native}")
|
||||
|
||||
# set(CPACK_NSIS_MUI_HEADERIMAGE "") # TODO: image should be 150x57 bmp
|
||||
set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}\\\\sunshine.ico")
|
||||
set(CPACK_NSIS_INSTALLED_ICON_NAME "${PROJECT__DIR}\\\\${PROJECT_EXE}")
|
||||
|
||||
# The name of the directory that will be created in C:/Program files/
|
||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}")
|
||||
|
||||
# Extra install commands
|
||||
# Restores permissions on the install directory
|
||||
# Migrates config files from the root into the new config folder
|
||||
# Install service
|
||||
SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS
|
||||
"${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}
|
||||
IfSilent +2 0
|
||||
ExecShell 'open' 'https://docs.lizardbyte.dev/projects/sunshine'
|
||||
nsExec::ExecToLog 'icacls \\\"$INSTDIR\\\" /reset'
|
||||
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\update-path.bat\\\" add'
|
||||
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\migrate-config.bat\\\"'
|
||||
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\add-firewall-rule.bat\\\"'
|
||||
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\install-gamepad.bat\\\"'
|
||||
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\install-service.bat\\\"'
|
||||
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\autostart-service.bat\\\"'
|
||||
NoController:
|
||||
")
|
||||
|
||||
# Extra uninstall commands
|
||||
# Uninstall service
|
||||
set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS
|
||||
"${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS}
|
||||
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\delete-firewall-rule.bat\\\"'
|
||||
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\uninstall-service.bat\\\"'
|
||||
nsExec::ExecToLog '\\\"$INSTDIR\\\\${CMAKE_PROJECT_NAME}.exe\\\" --restore-nvprefs-undo'
|
||||
MessageBox MB_YESNO|MB_ICONQUESTION \
|
||||
'Do you want to remove Virtual Gamepad?' \
|
||||
/SD IDNO IDNO NoGamepad
|
||||
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\uninstall-gamepad.bat\\\"'; skipped if no
|
||||
NoGamepad:
|
||||
MessageBox MB_YESNO|MB_ICONQUESTION \
|
||||
'Do you want to remove $INSTDIR (this includes the configuration, cover images, and settings)?' \
|
||||
/SD IDNO IDNO NoDelete
|
||||
RMDir /r \\\"$INSTDIR\\\"; skipped if no
|
||||
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\update-path.bat\\\" remove'
|
||||
NoDelete:
|
||||
")
|
||||
|
||||
# Adding an option for the start menu
|
||||
set(CPACK_NSIS_MODIFY_PATH OFF)
|
||||
set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".")
|
||||
# This will be shown on the installed apps Windows settings
|
||||
set(CPACK_NSIS_INSTALLED_ICON_NAME "${CMAKE_PROJECT_NAME}.exe")
|
||||
set(CPACK_NSIS_CREATE_ICONS_EXTRA
|
||||
"${CPACK_NSIS_CREATE_ICONS_EXTRA}
|
||||
SetOutPath '\$INSTDIR'
|
||||
CreateShortCut '\$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\${CMAKE_PROJECT_NAME}.lnk' \
|
||||
'\$INSTDIR\\\\${CMAKE_PROJECT_NAME}.exe' '--shortcut'
|
||||
")
|
||||
set(CPACK_NSIS_DELETE_ICONS_EXTRA
|
||||
"${CPACK_NSIS_DELETE_ICONS_EXTRA}
|
||||
Delete '\$SMPROGRAMS\\\\$MUI_TEMP\\\\${CMAKE_PROJECT_NAME}.lnk'
|
||||
")
|
||||
|
||||
# Checking for previous installed versions
|
||||
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL "ON")
|
||||
|
||||
set(CPACK_NSIS_HELP_LINK "https://docs.lizardbyte.dev/projects/sunshine/latest/md_docs_2getting__started.html")
|
||||
set(CPACK_NSIS_URL_INFO_ABOUT "${CMAKE_PROJECT_HOMEPAGE_URL}")
|
||||
set(CPACK_NSIS_CONTACT "${CMAKE_PROJECT_HOMEPAGE_URL}/support")
|
||||
|
||||
set(CPACK_NSIS_MENU_LINKS
|
||||
"https://docs.lizardbyte.dev/projects/sunshine" "Sunshine documentation"
|
||||
"https://app.lizardbyte.dev" "LizardByte Web Site"
|
||||
"https://app.lizardbyte.dev/support" "LizardByte Support")
|
||||
set(CPACK_NSIS_MANIFEST_DPI_AWARE true)
|
||||
|
||||
# Setting components groups and dependencies
|
||||
set(CPACK_COMPONENT_GROUP_CORE_EXPANDED true)
|
||||
|
||||
@@ -165,3 +109,7 @@ set(CPACK_COMPONENT_FIREWALL_GROUP "Scripts")
|
||||
set(CPACK_COMPONENT_GAMEPAD_DISPLAY_NAME "Virtual Gamepad")
|
||||
set(CPACK_COMPONENT_GAMEPAD_DESCRIPTION "Scripts to install and uninstall Virtual Gamepad.")
|
||||
set(CPACK_COMPONENT_GAMEPAD_GROUP "Scripts")
|
||||
|
||||
# include specific packaging
|
||||
include(${CMAKE_MODULE_PATH}/packaging/windows_nsis.cmake)
|
||||
include(${CMAKE_MODULE_PATH}/packaging/windows_wix.cmake)
|
||||
|
||||
74
cmake/packaging/windows_nsis.cmake
Normal file
74
cmake/packaging/windows_nsis.cmake
Normal file
@@ -0,0 +1,74 @@
|
||||
# NSIS Packaging
|
||||
# see options at: https://cmake.org/cmake/help/latest/cpack_gen/nsis.html
|
||||
|
||||
set(CPACK_NSIS_INSTALLED_ICON_NAME "${PROJECT__DIR}\\\\${PROJECT_EXE}")
|
||||
|
||||
# Extra install commands
|
||||
# Restores permissions on the install directory
|
||||
# Migrates config files from the root into the new config folder
|
||||
# Install service
|
||||
SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS
|
||||
"${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}
|
||||
IfSilent +2 0
|
||||
ExecShell 'open' 'https://docs.lizardbyte.dev/projects/sunshine'
|
||||
nsExec::ExecToLog 'icacls \\\"$INSTDIR\\\" /reset'
|
||||
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\update-path.bat\\\" add'
|
||||
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\migrate-config.bat\\\"'
|
||||
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\add-firewall-rule.bat\\\"'
|
||||
nsExec::ExecToLog \
|
||||
'powershell.exe -ExecutionPolicy Bypass -File \\\"$INSTDIR\\\\scripts\\\\install-gamepad.ps1\\\"'
|
||||
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\install-service.bat\\\"'
|
||||
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\autostart-service.bat\\\"'
|
||||
NoController:
|
||||
")
|
||||
|
||||
# Extra uninstall commands
|
||||
# Uninstall service
|
||||
set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS
|
||||
"${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS}
|
||||
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\delete-firewall-rule.bat\\\"'
|
||||
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\uninstall-service.bat\\\"'
|
||||
nsExec::ExecToLog '\\\"$INSTDIR\\\\${CMAKE_PROJECT_NAME}.exe\\\" --restore-nvprefs-undo'
|
||||
MessageBox MB_YESNO|MB_ICONQUESTION \
|
||||
'Do you want to remove Virtual Gamepad?' \
|
||||
/SD IDNO IDNO NoGamepad
|
||||
nsExec::ExecToLog \
|
||||
'powershell.exe -ExecutionPolicy Bypass -File \\\"$INSTDIR\\\\scripts\\\\uninstall-gamepad.ps1\\\"'; \
|
||||
skipped if no
|
||||
NoGamepad:
|
||||
MessageBox MB_YESNO|MB_ICONQUESTION \
|
||||
'Do you want to remove $INSTDIR (this includes the configuration, cover images, and settings)?' \
|
||||
/SD IDNO IDNO NoDelete
|
||||
RMDir /r \\\"$INSTDIR\\\"; skipped if no
|
||||
nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\update-path.bat\\\" remove'
|
||||
NoDelete:
|
||||
")
|
||||
|
||||
# Adding an option for the start menu
|
||||
set(CPACK_NSIS_MODIFY_PATH OFF)
|
||||
set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".")
|
||||
# This will be shown on the installed apps Windows settings
|
||||
set(CPACK_NSIS_INSTALLED_ICON_NAME "${CMAKE_PROJECT_NAME}.exe")
|
||||
set(CPACK_NSIS_CREATE_ICONS_EXTRA
|
||||
"${CPACK_NSIS_CREATE_ICONS_EXTRA}
|
||||
SetOutPath '\$INSTDIR'
|
||||
CreateShortCut '\$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\${CMAKE_PROJECT_NAME}.lnk' \
|
||||
'\$INSTDIR\\\\${CMAKE_PROJECT_NAME}.exe' '--shortcut'
|
||||
")
|
||||
set(CPACK_NSIS_DELETE_ICONS_EXTRA
|
||||
"${CPACK_NSIS_DELETE_ICONS_EXTRA}
|
||||
Delete '\$SMPROGRAMS\\\\$MUI_TEMP\\\\${CMAKE_PROJECT_NAME}.lnk'
|
||||
")
|
||||
|
||||
# Checking for previous installed versions
|
||||
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL "ON")
|
||||
|
||||
set(CPACK_NSIS_HELP_LINK "https://docs.lizardbyte.dev/projects/sunshine/latest/md_docs_2getting__started.html")
|
||||
set(CPACK_NSIS_URL_INFO_ABOUT "${CMAKE_PROJECT_HOMEPAGE_URL}")
|
||||
set(CPACK_NSIS_CONTACT "${CMAKE_PROJECT_HOMEPAGE_URL}/support")
|
||||
|
||||
set(CPACK_NSIS_MENU_LINKS
|
||||
"https://docs.lizardbyte.dev/projects/sunshine" "Sunshine documentation"
|
||||
"https://app.lizardbyte.dev" "LizardByte Web Site"
|
||||
"https://app.lizardbyte.dev/support" "LizardByte Support")
|
||||
set(CPACK_NSIS_MANIFEST_DPI_AWARE true)
|
||||
4
cmake/packaging/windows_wix.cmake
Normal file
4
cmake/packaging/windows_wix.cmake
Normal file
@@ -0,0 +1,4 @@
|
||||
# WIX Packaging
|
||||
# see options at: https://cmake.org/cmake/help/latest/cpack_gen/wix.html
|
||||
|
||||
# TODO: Replace nsis with wix
|
||||
@@ -1,18 +1,34 @@
|
||||
# Set build variables if env variables are defined
|
||||
# These are used in configured files such as manifests for different packages
|
||||
if(DEFINED ENV{BRANCH})
|
||||
set(GITHUB_BRANCH $ENV{BRANCH})
|
||||
endif()
|
||||
if(DEFINED ENV{BUILD_VERSION}) # cmake-lint: disable=W0106
|
||||
set(BUILD_VERSION $ENV{BUILD_VERSION})
|
||||
endif()
|
||||
if(DEFINED ENV{CLONE_URL})
|
||||
set(GITHUB_CLONE_URL $ENV{CLONE_URL})
|
||||
endif()
|
||||
if(DEFINED ENV{COMMIT})
|
||||
set(GITHUB_COMMIT $ENV{COMMIT})
|
||||
endif()
|
||||
if(DEFINED ENV{TAG})
|
||||
set(GITHUB_TAG $ENV{TAG})
|
||||
endif()
|
||||
|
||||
# Check if env vars are defined before attempting to access them, variables will be defined even if blank
|
||||
if((DEFINED ENV{BRANCH}) AND (DEFINED ENV{BUILD_VERSION}) AND (DEFINED ENV{COMMIT})) # cmake-lint: disable=W0106
|
||||
if(($ENV{BRANCH} STREQUAL "master") AND (NOT $ENV{BUILD_VERSION} STREQUAL ""))
|
||||
# If BRANCH is "master" and BUILD_VERSION is not empty, then we are building a master branch
|
||||
MESSAGE("Got from CI master branch and version $ENV{BUILD_VERSION}")
|
||||
if((DEFINED ENV{BRANCH}) AND (DEFINED ENV{BUILD_VERSION})) # cmake-lint: disable=W0106
|
||||
if((DEFINED ENV{BRANCH}) AND (NOT $ENV{BUILD_VERSION} STREQUAL ""))
|
||||
# If BRANCH is defined and BUILD_VERSION is not empty, then we are building from CI
|
||||
# If BRANCH is master we are building a push/release build
|
||||
MESSAGE("Got from CI '$ENV{BRANCH}' branch and version '$ENV{BUILD_VERSION}'")
|
||||
set(PROJECT_VERSION $ENV{BUILD_VERSION})
|
||||
string(REGEX REPLACE "^v" "" PROJECT_VERSION ${PROJECT_VERSION}) # remove the v prefix if it exists
|
||||
set(CMAKE_PROJECT_VERSION ${PROJECT_VERSION}) # cpack will use this to set the binary versions
|
||||
elseif((DEFINED ENV{BRANCH}) AND (DEFINED ENV{COMMIT}))
|
||||
# If BRANCH is set but not BUILD_VERSION we are building a PR, we gather only the commit hash
|
||||
MESSAGE("Got from CI $ENV{BRANCH} branch and commit $ENV{COMMIT}")
|
||||
set(PROJECT_VERSION ${PROJECT_VERSION}.$ENV{COMMIT})
|
||||
endif()
|
||||
else()
|
||||
# Generate Sunshine Version based of the git tag
|
||||
# https://github.com/nocnokneo/cmake-git-versioning-example/blob/master/LICENSE
|
||||
else()
|
||||
find_package(Git)
|
||||
if(GIT_EXECUTABLE)
|
||||
MESSAGE("${CMAKE_SOURCE_DIR}")
|
||||
@@ -54,3 +70,72 @@ else()
|
||||
MESSAGE(WARNING ": Git not found, cannot find git version")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# set date variables
|
||||
set(PROJECT_YEAR "1990")
|
||||
set(PROJECT_MONTH "01")
|
||||
set(PROJECT_DAY "01")
|
||||
|
||||
# Extract year, month, and day (do this AFTER version parsing)
|
||||
# Note: Cmake doesn't support "{}" regex syntax
|
||||
if(PROJECT_VERSION MATCHES "^([0-9][0-9][0-9][0-9])\\.([0-9][0-9][0-9][0-9]?)\\.([0-9]+)$")
|
||||
message("Extracting year and month/day from PROJECT_VERSION: ${PROJECT_VERSION}")
|
||||
# First capture group is the year
|
||||
set(PROJECT_YEAR "${CMAKE_MATCH_1}")
|
||||
|
||||
# Second capture group contains month and day
|
||||
set(MONTH_DAY "${CMAKE_MATCH_2}")
|
||||
|
||||
# Extract month (first 1-2 digits) and day (last 2 digits)
|
||||
string(LENGTH "${MONTH_DAY}" MONTH_DAY_LENGTH)
|
||||
if(MONTH_DAY_LENGTH EQUAL 3)
|
||||
# Format: MDD (e.g., 703 = month 7, day 03)
|
||||
string(SUBSTRING "${MONTH_DAY}" 0 1 PROJECT_MONTH)
|
||||
string(SUBSTRING "${MONTH_DAY}" 1 2 PROJECT_DAY)
|
||||
elseif(MONTH_DAY_LENGTH EQUAL 4)
|
||||
# Format: MMDD (e.g., 1203 = month 12, day 03)
|
||||
string(SUBSTRING "${MONTH_DAY}" 0 2 PROJECT_MONTH)
|
||||
string(SUBSTRING "${MONTH_DAY}" 2 2 PROJECT_DAY)
|
||||
endif()
|
||||
|
||||
# Ensure month is two digits
|
||||
if(PROJECT_MONTH LESS 10 AND NOT PROJECT_MONTH MATCHES "^0")
|
||||
set(PROJECT_MONTH "0${PROJECT_MONTH}")
|
||||
endif()
|
||||
# Ensure day is two digits
|
||||
if(PROJECT_DAY LESS 10 AND NOT PROJECT_DAY MATCHES "^0")
|
||||
set(PROJECT_DAY "0${PROJECT_DAY}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Parse PROJECT_VERSION to extract major, minor, and patch components
|
||||
if(PROJECT_VERSION MATCHES "([0-9]+)\\.([0-9]+)\\.([0-9]+)")
|
||||
set(PROJECT_VERSION_MAJOR "${CMAKE_MATCH_1}")
|
||||
set(CMAKE_PROJECT_VERSION_MAJOR "${CMAKE_MATCH_1}")
|
||||
|
||||
set(PROJECT_VERSION_MINOR "${CMAKE_MATCH_2}")
|
||||
set(CMAKE_PROJECT_VERSION_MINOR "${CMAKE_MATCH_2}")
|
||||
|
||||
set(PROJECT_VERSION_PATCH "${CMAKE_MATCH_3}")
|
||||
set(CMAKE_PROJECT_VERSION_PATCH "${CMAKE_MATCH_3}")
|
||||
endif()
|
||||
|
||||
message("PROJECT_NAME: ${PROJECT_NAME}")
|
||||
message("PROJECT_VERSION: ${PROJECT_VERSION}")
|
||||
message("PROJECT_VERSION_MAJOR: ${PROJECT_VERSION_MAJOR}")
|
||||
message("PROJECT_VERSION_MINOR: ${PROJECT_VERSION_MINOR}")
|
||||
message("PROJECT_VERSION_PATCH: ${PROJECT_VERSION_PATCH}")
|
||||
message("CMAKE_PROJECT_VERSION: ${CMAKE_PROJECT_VERSION}")
|
||||
message("CMAKE_PROJECT_VERSION_MAJOR: ${CMAKE_PROJECT_VERSION_MAJOR}")
|
||||
message("CMAKE_PROJECT_VERSION_MINOR: ${CMAKE_PROJECT_VERSION_MINOR}")
|
||||
message("CMAKE_PROJECT_VERSION_PATCH: ${CMAKE_PROJECT_VERSION_PATCH}")
|
||||
message("PROJECT_YEAR: ${PROJECT_YEAR}")
|
||||
message("PROJECT_MONTH: ${PROJECT_MONTH}")
|
||||
message("PROJECT_DAY: ${PROJECT_DAY}")
|
||||
|
||||
list(APPEND SUNSHINE_DEFINITIONS PROJECT_NAME="${PROJECT_NAME}")
|
||||
list(APPEND SUNSHINE_DEFINITIONS PROJECT_VERSION="${PROJECT_VERSION}")
|
||||
list(APPEND SUNSHINE_DEFINITIONS PROJECT_VERSION_MAJOR="${PROJECT_VERSION_MAJOR}")
|
||||
list(APPEND SUNSHINE_DEFINITIONS PROJECT_VERSION_MINOR="${PROJECT_VERSION_MINOR}")
|
||||
list(APPEND SUNSHINE_DEFINITIONS PROJECT_VERSION_PATCH="${PROJECT_VERSION_PATCH}")
|
||||
list(APPEND SUNSHINE_DEFINITIONS PROJECT_VERSION_COMMIT="${GITHUB_COMMIT}")
|
||||
|
||||
@@ -10,7 +10,6 @@ set(SUNSHINE_PUBLISHER_ISSUE_URL "https://app.lizardbyte.dev/support"
|
||||
option(BUILD_DOCS "Build documentation" ON)
|
||||
option(BUILD_TESTS "Build tests" ON)
|
||||
option(NPM_OFFLINE "Use offline npm packages. You must ensure packages are in your npm cache." OFF)
|
||||
option(TESTS_ENABLE_PYTHON_TESTS "Enable Python tests" ON)
|
||||
|
||||
option(BUILD_WERROR "Enable -Werror flag." OFF)
|
||||
|
||||
|
||||
@@ -12,19 +12,17 @@ elseif(UNIX)
|
||||
# configure the .desktop file
|
||||
set(SUNSHINE_DESKTOP_ICON "sunshine")
|
||||
if(${SUNSHINE_BUILD_APPIMAGE})
|
||||
configure_file(packaging/linux/AppImage/sunshine.desktop sunshine.desktop @ONLY)
|
||||
configure_file(packaging/linux/AppImage/${PROJECT_FQDN}.desktop ${PROJECT_FQDN}.desktop @ONLY)
|
||||
elseif(${SUNSHINE_BUILD_FLATPAK})
|
||||
set(SUNSHINE_DESKTOP_ICON "${PROJECT_FQDN}")
|
||||
configure_file(packaging/linux/flatpak/sunshine.desktop sunshine.desktop @ONLY)
|
||||
configure_file(packaging/linux/flatpak/${PROJECT_FQDN}.metainfo.xml
|
||||
${PROJECT_FQDN}.metainfo.xml @ONLY)
|
||||
configure_file(packaging/linux/flatpak/${PROJECT_FQDN}.desktop ${PROJECT_FQDN}.desktop @ONLY)
|
||||
else()
|
||||
configure_file(packaging/linux/sunshine.desktop sunshine.desktop @ONLY)
|
||||
configure_file(packaging/linux/sunshine_terminal.desktop sunshine_terminal.desktop @ONLY)
|
||||
configure_file(packaging/linux/${PROJECT_FQDN}.desktop ${PROJECT_FQDN}.desktop @ONLY)
|
||||
configure_file(packaging/linux/${PROJECT_FQDN}.terminal.desktop ${PROJECT_FQDN}.terminal.desktop @ONLY)
|
||||
endif()
|
||||
|
||||
# configure metadata file
|
||||
configure_file(packaging/linux/sunshine.appdata.xml sunshine.appdata.xml @ONLY)
|
||||
configure_file(packaging/linux/${PROJECT_FQDN}.metainfo.xml ${PROJECT_FQDN}.metainfo.xml @ONLY)
|
||||
|
||||
# configure service
|
||||
configure_file(packaging/linux/sunshine.service.in sunshine.service @ONLY)
|
||||
@@ -38,8 +36,6 @@ elseif(UNIX)
|
||||
# configure the flatpak manifest
|
||||
if(${SUNSHINE_CONFIGURE_FLATPAK_MAN})
|
||||
configure_file(packaging/linux/flatpak/${PROJECT_FQDN}.yml ${PROJECT_FQDN}.yml @ONLY)
|
||||
configure_file(packaging/linux/flatpak/${PROJECT_FQDN}.metainfo.xml
|
||||
${PROJECT_FQDN}.metainfo.xml @ONLY)
|
||||
file(COPY packaging/linux/flatpak/deps/ DESTINATION ${CMAKE_BINARY_DIR})
|
||||
file(COPY packaging/linux/flatpak/modules DESTINATION ${CMAKE_BINARY_DIR})
|
||||
file(COPY generated-sources.json DESTINATION ${CMAKE_BINARY_DIR})
|
||||
|
||||
@@ -27,7 +27,7 @@ endif()
|
||||
|
||||
target_link_libraries(sunshine ${SUNSHINE_EXTERNAL_LIBRARIES} ${EXTRA_LIBS})
|
||||
target_compile_definitions(sunshine PUBLIC ${SUNSHINE_DEFINITIONS})
|
||||
set_target_properties(sunshine PROPERTIES CXX_STANDARD 20
|
||||
set_target_properties(sunshine PROPERTIES CXX_STANDARD 23
|
||||
VERSION ${PROJECT_VERSION}
|
||||
SOVERSION ${PROJECT_VERSION_MAJOR})
|
||||
|
||||
|
||||
@@ -3,5 +3,6 @@ set_target_properties(sunshine PROPERTIES LINK_SEARCH_START_STATIC 1)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll")
|
||||
find_library(ZLIB ZLIB1)
|
||||
list(APPEND SUNSHINE_EXTERNAL_LIBRARIES
|
||||
$<TARGET_OBJECTS:sunshine_rc_object>
|
||||
Windowsapp.lib
|
||||
Wtsapi32.lib)
|
||||
|
||||
@@ -17,7 +17,9 @@
|
||||
"two_letters_code": {
|
||||
# map non-two letter codes here, left side is crowdin designation, right side is babel designation
|
||||
"en-GB": "en_GB",
|
||||
"en-US": "en_US"
|
||||
"en-US": "en_US",
|
||||
"pt-BR": "pt_BR",
|
||||
"zh-TW": "zh_TW"
|
||||
}
|
||||
},
|
||||
"update_option": "update_as_unapproved"
|
||||
|
||||
@@ -28,10 +28,10 @@ ARG CLONE_URL
|
||||
ENV BRANCH=${BRANCH}
|
||||
ENV BUILD_VERSION=${BUILD_VERSION}
|
||||
ENV COMMIT=${COMMIT}
|
||||
ENV CLONE_URL=${CLONE_URL}
|
||||
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
|
||||
# hadolint ignore=SC2016
|
||||
RUN <<_SETUP
|
||||
#!/bin/bash
|
||||
set -e
|
||||
@@ -41,6 +41,7 @@ useradd -m builder
|
||||
echo 'builder ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
|
||||
|
||||
# patch the build flags
|
||||
# shellcheck disable=SC2016
|
||||
sed -i 's,#MAKEFLAGS="-j2",MAKEFLAGS="-j$(nproc)",g' /etc/makepkg.conf
|
||||
|
||||
# install dependencies
|
||||
@@ -68,19 +69,16 @@ WORKDIR /build/sunshine/build
|
||||
RUN <<_MAKE
|
||||
#!/bin/bash
|
||||
set -e
|
||||
if [[ "${BUILD_VERSION}" == '' ]]; then
|
||||
|
||||
sub_version=""
|
||||
if [[ "${BRANCH}" != "master" ]]; then
|
||||
sub_version=".r${COMMIT}"
|
||||
else
|
||||
sub_version=""
|
||||
fi
|
||||
|
||||
cmake \
|
||||
-DSUNSHINE_CONFIGURE_ONLY=ON \
|
||||
-DSUNSHINE_CONFIGURE_PKGBUILD=ON \
|
||||
-DSUNSHINE_SUB_VERSION="${sub_version}" \
|
||||
-DGITHUB_CLONE_URL="${CLONE_URL}" \
|
||||
-DGITHUB_BRANCH=${BRANCH} \
|
||||
-DGITHUB_BUILD_VERSION=${BUILD_VERSION} \
|
||||
-DGITHUB_COMMIT="${COMMIT}" \
|
||||
-DSUNSHINE_CONFIGURE_ONLY=ON \
|
||||
/build/sunshine
|
||||
_MAKE
|
||||
|
||||
@@ -114,14 +112,13 @@ rm -f /build/sunshine/pkg/sunshine-debug*.pkg.tar.zst
|
||||
ls -a
|
||||
_PKGBUILD
|
||||
|
||||
FROM scratch AS artifacts
|
||||
|
||||
COPY --link --from=sunshine-build /build/sunshine/pkg/sunshine*.pkg.tar.zst /sunshine.pkg.tar.zst
|
||||
COPY --link --from=sunshine-build /build/sunshine/sunshine.pkg.tar.gz /sunshine.pkg.tar.gz
|
||||
|
||||
FROM sunshine-base AS sunshine
|
||||
|
||||
COPY --link --from=artifacts /sunshine.pkg.tar.zst /
|
||||
COPY --link --from=sunshine-build /build/sunshine/pkg/sunshine*.pkg.tar.zst /sunshine.pkg.tar.zst
|
||||
|
||||
# artifacts to be extracted in CI
|
||||
COPY --link --from=sunshine-build /build/sunshine/pkg/sunshine*.pkg.tar.zst /artifacts/sunshine.pkg.tar.zst
|
||||
COPY --link --from=sunshine-build /build/sunshine/sunshine.pkg.tar.gz /artifacts/sunshine.pkg.tar.gz
|
||||
|
||||
# install sunshine
|
||||
RUN <<_INSTALL_SUNSHINE
|
||||
|
||||
@@ -19,7 +19,6 @@ ENV DISPLAY=:0
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
|
||||
# install dependencies
|
||||
# hadolint ignore=SC1091
|
||||
RUN <<_DEPS
|
||||
#!/bin/bash
|
||||
set -e
|
||||
@@ -74,7 +73,6 @@ WORKDIR /build/cuda
|
||||
# versions: https://developer.nvidia.com/cuda-toolkit-archive
|
||||
ENV CUDA_VERSION="11.8.0"
|
||||
ENV CUDA_BUILD="520.61.05"
|
||||
# hadolint ignore=SC3010
|
||||
RUN <<_INSTALL_CUDA
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
@@ -42,7 +42,6 @@ _BUILD
|
||||
|
||||
# run tests
|
||||
WORKDIR /build/sunshine/build/tests
|
||||
# hadolint ignore=SC1091
|
||||
RUN <<_TEST
|
||||
#!/bin/bash
|
||||
set -e
|
||||
@@ -51,16 +50,17 @@ Xvfb ${DISPLAY} -screen 0 1024x768x24 &
|
||||
./test_sunshine --gtest_color=yes
|
||||
_TEST
|
||||
|
||||
FROM scratch AS artifacts
|
||||
FROM sunshine-base AS sunshine
|
||||
|
||||
ARG BASE
|
||||
ARG TAG
|
||||
ARG TARGETARCH
|
||||
COPY --link --from=sunshine-build /build/sunshine/build/cpack_artifacts/Sunshine.deb /sunshine-${BASE}-${TAG}-${TARGETARCH}.deb
|
||||
|
||||
FROM sunshine-base AS sunshine
|
||||
# artifacts to be extracted in CI
|
||||
COPY --link --from=sunshine-build /build/sunshine/build/cpack_artifacts/Sunshine.deb /artifacts/sunshine-${BASE}-${TAG}-${TARGETARCH}.deb
|
||||
|
||||
# copy deb from builder
|
||||
COPY --link --from=artifacts /sunshine*.deb /sunshine.deb
|
||||
COPY --link --from=sunshine-build /build/sunshine/build/cpack_artifacts/Sunshine.deb /sunshine.deb
|
||||
|
||||
# install sunshine
|
||||
RUN <<_INSTALL_SUNSHINE
|
||||
|
||||
@@ -42,7 +42,6 @@ _BUILD
|
||||
|
||||
# run tests
|
||||
WORKDIR /build/sunshine/build/tests
|
||||
# hadolint ignore=SC1091
|
||||
RUN <<_TEST
|
||||
#!/bin/bash
|
||||
set -e
|
||||
@@ -51,16 +50,17 @@ Xvfb ${DISPLAY} -screen 0 1024x768x24 &
|
||||
./test_sunshine --gtest_color=yes
|
||||
_TEST
|
||||
|
||||
FROM scratch AS artifacts
|
||||
FROM sunshine-base AS sunshine
|
||||
|
||||
ARG BASE
|
||||
ARG TAG
|
||||
ARG TARGETARCH
|
||||
COPY --link --from=sunshine-build /build/sunshine/build/cpack_artifacts/Sunshine.deb /sunshine-${BASE}-${TAG}-${TARGETARCH}.deb
|
||||
|
||||
FROM sunshine-base AS sunshine
|
||||
# artifacts to be extracted in CI
|
||||
COPY --link --from=sunshine-build /build/sunshine/build/cpack_artifacts/Sunshine.deb /artifacts/sunshine-${BASE}-${TAG}-${TARGETARCH}.deb
|
||||
|
||||
# copy deb from builder
|
||||
COPY --link --from=artifacts /sunshine*.deb /sunshine.deb
|
||||
COPY --link --from=sunshine-build /build/sunshine/build/cpack_artifacts/Sunshine.deb /sunshine.deb
|
||||
|
||||
# install sunshine
|
||||
RUN <<_INSTALL_SUNSHINE
|
||||
|
||||
@@ -42,7 +42,6 @@ _BUILD
|
||||
|
||||
# run tests
|
||||
WORKDIR /build/sunshine/build/tests
|
||||
# hadolint ignore=SC1091
|
||||
RUN <<_TEST
|
||||
#!/bin/bash
|
||||
set -e
|
||||
@@ -51,16 +50,17 @@ Xvfb ${DISPLAY} -screen 0 1024x768x24 &
|
||||
./test_sunshine --gtest_color=yes
|
||||
_TEST
|
||||
|
||||
FROM scratch AS artifacts
|
||||
FROM sunshine-base AS sunshine
|
||||
|
||||
ARG BASE
|
||||
ARG TAG
|
||||
ARG TARGETARCH
|
||||
COPY --link --from=sunshine-build /build/sunshine/build/cpack_artifacts/Sunshine.deb /sunshine-${BASE}-${TAG}-${TARGETARCH}.deb
|
||||
|
||||
FROM sunshine-base AS sunshine
|
||||
# artifacts to be extracted in CI
|
||||
COPY --link --from=sunshine-build /build/sunshine/build/cpack_artifacts/Sunshine.deb /artifacts/sunshine-${BASE}-${TAG}-${TARGETARCH}.deb
|
||||
|
||||
# copy deb from builder
|
||||
COPY --link --from=artifacts /sunshine*.deb /sunshine.deb
|
||||
COPY --link --from=sunshine-build /build/sunshine/build/cpack_artifacts/Sunshine.deb /sunshine.deb
|
||||
|
||||
# install sunshine
|
||||
RUN <<_INSTALL_SUNSHINE
|
||||
|
||||
@@ -9,7 +9,7 @@ function generateExamples(endpoint, method, body = null) {
|
||||
}
|
||||
|
||||
return {
|
||||
cURL: `curl -u user:pass -X ${method.trim()} -k https://localhost:47990${endpoint.trim()}${curlBodyString}`,
|
||||
cURL: `curl -u user:pass -H "Content-Type: application/json" -X ${method.trim()} -k https://localhost:47990${endpoint.trim()}${curlBodyString}`,
|
||||
Python: `import json
|
||||
import requests
|
||||
from requests.auth import HTTPBasicAuth
|
||||
@@ -30,6 +30,7 @@ requests.${method.trim().toLowerCase()}(
|
||||
.then(data => console.log(data));`,
|
||||
PowerShell: `Invoke-RestMethod \`
|
||||
-SkipCertificateCheck \`
|
||||
-ContentType 'application/json' \`
|
||||
-Uri 'https://localhost:47990${endpoint.trim()}' \`
|
||||
-Method ${method.trim()} \`
|
||||
-Headers @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes('user:pass'))}
|
||||
|
||||
@@ -57,10 +57,14 @@ editing the `conf` file in a text editor. Use the examples as reference.
|
||||
@endcode</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="18">Choices</td>
|
||||
<td rowspan="20">Choices</td>
|
||||
<td>bg</td>
|
||||
<td>Bulgarian</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>cs</td>
|
||||
<td>Czech</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>de</td>
|
||||
<td>German</td>
|
||||
@@ -129,6 +133,10 @@ editing the `conf` file in a text editor. Use the examples as reference.
|
||||
<td>zh</td>
|
||||
<td>Chinese (Simplified)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>zh_TW</td>
|
||||
<td>Chinese (Traditional)</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
### sunshine_name
|
||||
@@ -1262,7 +1270,7 @@ editing the `conf` file in a text editor. Use the examples as reference.
|
||||
<td colspan="2">
|
||||
Remap the requested resolution and FPS to another display mode.<br>
|
||||
Depending on the [dd_resolution_option](#dd_resolution_option) and
|
||||
[dd_refresh_rate_option](#dd_refresh_rate_option) values, the following mapping
|
||||
[dd_refresh_rate_option](#dd_refresh_rate_option) values, the following mapping
|
||||
groups are available:
|
||||
<ul>
|
||||
<li>`mixed` - both options are set to `auto`.</li>
|
||||
@@ -1273,7 +1281,7 @@ editing the `conf` file in a text editor. Use the examples as reference.
|
||||
`refresh_rate_only` - only [dd_refresh_rate_option](#dd_refresh_rate_option) is set to `auto`.
|
||||
</li>
|
||||
</ul>
|
||||
For each of those groups, a list of fields can be configured to perform remapping:
|
||||
For each of those groups, a list of fields can be configured to perform remapping:
|
||||
<ul>
|
||||
<li>
|
||||
`requested_resolution` - resolution that needs to be matched in order to use this remapping entry.
|
||||
@@ -1283,10 +1291,10 @@ editing the `conf` file in a text editor. Use the examples as reference.
|
||||
<li>`final_refresh_rate` - refresh rate value to be used if the entry was matched.</li>
|
||||
</ul>
|
||||
If `requested_*` field is left empty, it will match <b>everything</b>.<br>
|
||||
If `final_*` field is left empty, the original value will not be remapped and either a requested, manual
|
||||
or current value is used. However, at least one `final_*` must be set, otherwise the entry is considered
|
||||
If `final_*` field is left empty, the original value will not be remapped and either a requested, manual
|
||||
or current value is used. However, at least one `final_*` must be set, otherwise the entry is considered
|
||||
invalid.<br>
|
||||
@note{"Optimize game settings" must be enabled on client side for ANY entry with `resolution`
|
||||
@note{"Optimize game settings" must be enabled on client side for ANY entry with `resolution`
|
||||
field to be considered.}
|
||||
@note{First entry to be matched in the list is the one that will be used.}
|
||||
@tip{`requested_resolution` and `final_resolution` can be omitted for `refresh_rate_only` group.}
|
||||
@@ -1363,32 +1371,29 @@ editing the `conf` file in a text editor. Use the examples as reference.
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
### min_fps_factor
|
||||
### minimum_fps_target
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>Description</td>
|
||||
<td colspan="2">
|
||||
Sunshine will use this factor to calculate the minimum time between frames. Increasing this value may help
|
||||
when streaming mostly static content.
|
||||
@warning{Higher values will consume more bandwidth.}
|
||||
Sunshine tries to save bandwidth when content on screen is static or a low framerate. Because many clients expect a constant stream of video frames, a certain amount of duplicate frames are sent when this happens. This setting controls the lowest effective framerate a stream can reach.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Default</td>
|
||||
<td colspan="2">@code{}
|
||||
1
|
||||
0
|
||||
@endcode</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Range</td>
|
||||
<td colspan="2">1-3</td>
|
||||
<td rowspan="3">Choices</td>
|
||||
<td>0</td>
|
||||
<td>Use half the stream's FPS as the minimum target.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Example</td>
|
||||
<td colspan="2">@code{}
|
||||
min_fps_factor = 1
|
||||
@endcode</td>
|
||||
<td>1-1000</td>
|
||||
<td>Specify your own value. The real minimum may differ from this value.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ Read our contribution guide in our organization level
|
||||
## Recommended Tools
|
||||
|
||||
| Tool | Description |
|
||||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| <a href="https://www.jetbrains.com/clion/"><img src="https://resources.jetbrains.com/storage/products/company/brand/logos/CLion_icon.svg" width="30" height="30"></a><br>CLion | Recommended IDE for C++ development. Free licenses available for open source developers through the [JetBrains Open Source Program](https://www.jetbrains.com/community/opensource/). |
|
||||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------|
|
||||
| <a href="https://www.jetbrains.com/clion/"><img src="https://resources.jetbrains.com/storage/products/company/brand/logos/CLion_icon.svg" width="30" height="30"></a><br>CLion | Recommended IDE for C and C++ development. Free for non-commercial use. |
|
||||
|
||||
## Project Patterns
|
||||
|
||||
|
||||
@@ -56,27 +56,28 @@ need to install CUDA.}
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="1">12.0.0</td>
|
||||
<td rowspan="2">525.60.13</td>
|
||||
<td rowspan="1">525.60.13</td>
|
||||
<td rowspan="5">50;52;60;61;62;70;72;75;80;86;87;89;90</td>
|
||||
<td>sunshine-debian-bookworm-{arch}.deb</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="1">12.5.1</td>
|
||||
<td>sunshine.pkg.tar.zst</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="2">12.6.2</td>
|
||||
<td rowspan="2">560.35.03</td>
|
||||
<td>sunshine_{arch}.flatpak</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Sunshine (copr - Fedora 40/41)</td>
|
||||
<td>Sunshine (copr - Fedora 41)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="1">12.8.1</td>
|
||||
<td rowspan="1">570.124.06</td>
|
||||
<td>Sunshine (copr - Fedora 42)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="1">12.9.1</td>
|
||||
<td rowspan="1">575.57.08</td>
|
||||
<td>sunshine.pkg.tar.zst</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
#### AppImage
|
||||
@@ -283,7 +284,7 @@ brew uninstall sunshine
|
||||
#### Installer (recommended)
|
||||
|
||||
1. Download and install
|
||||
[sunshine-windows-installer.exe](https://github.com/LizardByte/Sunshine/releases/latest/download/sunshine-windows-installer.exe)
|
||||
[Sunshine-Windows-AMD64-installer.exe](https://github.com/LizardByte/Sunshine/releases/latest/download/Sunshine-Windows-AMD64-installer.exe)
|
||||
|
||||
@attention{You should carefully select or unselect the options you want to install. Do not blindly install or
|
||||
enable features.}
|
||||
@@ -297,7 +298,7 @@ overflow menu. Different versions of Windows may provide slightly different step
|
||||
recommended for most users. No support will be provided!}
|
||||
|
||||
1. Download and extract
|
||||
[sunshine-windows-portable.zip](https://github.com/LizardByte/Sunshine/releases/latest/download/sunshine-windows-portable.zip)
|
||||
[Sunshine-Windows-AMD64-portable.zip](https://github.com/LizardByte/Sunshine/releases/latest/download/Sunshine-Windows-AMD64-portable.zip)
|
||||
2. Open command prompt as administrator
|
||||
3. Firewall rules
|
||||
|
||||
|
||||
@@ -84,9 +84,35 @@ client only 1 Gbit/s or Wi-Fi. Similarly, a 1 Gbps host may be too fast for a
|
||||
client having only a 100 Mbps interface.
|
||||
|
||||
As a workaround the transmission speed of the host NIC can be reduced: 1 Gbps
|
||||
instead of 2.5 or 100 Mbps instead of 1 Gbps. (A technically more advanced
|
||||
instead of 2.5 or 100 Mbps instead of 1 Gbps. A technically more advanced
|
||||
solution would be to configure traffic shaping rules at the OS-level, so that
|
||||
only Sunshine's traffic is slowed down.)
|
||||
only Sunshine's traffic is slowed down.
|
||||
|
||||
Such a solution on Linux could look like that:
|
||||
|
||||
```bash
|
||||
# 1) Remove existing qdisc (pfifo_fast)
|
||||
sudo tc qdisc del dev <NIC> root
|
||||
|
||||
# 2) Add HTB root qdisc with default class 1:1
|
||||
sudo tc qdisc add dev <NIC> root handle 1: htb default 1
|
||||
|
||||
# 3) Create class 1:1 for full 10 Gbit/s (all other traffic)
|
||||
sudo tc class add dev <NIC> parent 1: classid 1:1 htb \
|
||||
rate 10000mbit ceil 10000mbit burst 32k
|
||||
|
||||
# 4) Create class 1:10 for Sunshine game stream at 1 Gbit/s
|
||||
sudo tc class add dev <NIC> parent 1: classid 1:10 htb \
|
||||
rate 1000mbit ceil 1000mbit burst 32k
|
||||
|
||||
# 5) Filter UDP source port 47998 into class 1:10
|
||||
sudo tc filter add dev <NIC> protocol ip parent 1: prio 1 \
|
||||
u32 match ip protocol 17 0xff \
|
||||
match ip sport 47998 0xffff flowid 1:10
|
||||
```
|
||||
|
||||
In that way only the Sunshine traffic is limited by 1 Gbit. This is not persistent on reboots.
|
||||
If you use a different port for the game stream you need to adjust the last command.
|
||||
|
||||
Sunshine versions > 0.23.1 include improved networking code that should
|
||||
alleviate or even solve this issue (without reducing the NIC speed).
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 133 KiB |
@@ -465,6 +465,36 @@ ext-js:
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- New Nintendo 3DS -->
|
||||
<div class="col-md-6 col-lg-4 mb-5">
|
||||
<div class="card bg-dark text-white rounded-0">
|
||||
<div class="card-body p-4">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="icon text-white">
|
||||
<img class="invert" src="https://cdn.jsdelivr.net/npm/simple-icons@v12/icons/nintendo3ds.svg" alt="3DS"/>
|
||||
</div>
|
||||
<div class="ms-3">
|
||||
<h5 class="fw-bolder mb-0">
|
||||
<a href="https://github.com/zoeyjodon/moonlight-N3DS" target="_blank" class="text-white text-decoration-none">
|
||||
New Nintendo 3DS
|
||||
</a>
|
||||
</h5>
|
||||
</div>
|
||||
<div class="ms-auto">
|
||||
<span class="badge text-bg-warning rounded-pill">Community</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer p-3 px-4">
|
||||
<div class="pb-3">
|
||||
<a href="https://github.com/zoeyjodon/moonlight-N3DS" target="_blank" class="btn btn-info">
|
||||
<i class="fas fa-download"></i> Download
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- LG webOS TV -->
|
||||
<div class="col-md-6 col-lg-4 mb-5">
|
||||
<div class="card bg-dark text-white rounded-0">
|
||||
|
||||
12
package.json
12
package.json
@@ -8,15 +8,15 @@
|
||||
"serve": "serve ./tests/fixtures/http --no-port-switching"
|
||||
},
|
||||
"dependencies": {
|
||||
"@lizardbyte/shared-web": "2025.326.11214",
|
||||
"vue": "3.5.13",
|
||||
"vue-i18n": "11.1.3"
|
||||
"@lizardbyte/shared-web": "2025.626.181239",
|
||||
"vue": "3.5.18",
|
||||
"vue-i18n": "11.1.11"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@codecov/vite-plugin": "1.9.0",
|
||||
"@codecov/vite-plugin": "1.9.1",
|
||||
"@vitejs/plugin-vue": "4.6.2",
|
||||
"serve": "14.2.3",
|
||||
"vite": "4.5.9",
|
||||
"serve": "14.2.4",
|
||||
"vite": "4.5.14",
|
||||
"vite-plugin-ejs": "1.6.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=@PROJECT_NAME@
|
||||
Exec=sunshine
|
||||
Version=1.0
|
||||
Categories=RemoteAccess;Network;
|
||||
Comment=@PROJECT_DESCRIPTION@
|
||||
Exec=sunshine
|
||||
Icon=sunshine
|
||||
Keywords=gamestream;stream;moonlight;remote play;
|
||||
Categories=AudioVideo;Network;RemoteAccess;
|
||||
Name=@PROJECT_NAME@
|
||||
Terminal=true
|
||||
Type=Application
|
||||
Version=1.0
|
||||
X-AppImage-Arch=x86_64
|
||||
X-AppImage-Name=sunshine
|
||||
X-AppImage-Version=@PROJECT_VERSION@
|
||||
X-AppImage-Arch=x86_64
|
||||
@@ -10,7 +10,7 @@ url=@PROJECT_HOMEPAGE_URL@
|
||||
license=('GPL-3.0-only')
|
||||
install=sunshine.install
|
||||
|
||||
_gcc_version=13
|
||||
_gcc_version=14
|
||||
|
||||
depends=(
|
||||
'avahi'
|
||||
@@ -36,7 +36,10 @@ depends=(
|
||||
)
|
||||
|
||||
makedepends=(
|
||||
'appstream'
|
||||
'appstream-glib'
|
||||
'cmake'
|
||||
'desktop-file-utils'
|
||||
'cuda'
|
||||
"gcc${_gcc_version}"
|
||||
'git'
|
||||
@@ -64,7 +67,7 @@ prepare() {
|
||||
|
||||
build() {
|
||||
export BRANCH="@GITHUB_BRANCH@"
|
||||
export BUILD_VERSION="@GITHUB_BUILD_VERSION@"
|
||||
export BUILD_VERSION="@BUILD_VERSION@"
|
||||
export COMMIT="@GITHUB_COMMIT@"
|
||||
|
||||
export CC="gcc-${_gcc_version}"
|
||||
@@ -86,6 +89,11 @@ build() {
|
||||
-D SUNSHINE_PUBLISHER_WEBSITE='https://app.lizardbyte.dev' \
|
||||
-D SUNSHINE_PUBLISHER_ISSUE_URL='https://app.lizardbyte.dev/support'
|
||||
|
||||
appstreamcli validate "build/dev.lizardbyte.app.Sunshine.metainfo.xml"
|
||||
appstream-util validate "build/dev.lizardbyte.app.Sunshine.metainfo.xml"
|
||||
desktop-file-validate "build/dev.lizardbyte.app.Sunshine.desktop"
|
||||
desktop-file-validate "build/dev.lizardbyte.app.Sunshine.terminal.desktop"
|
||||
|
||||
make -C build
|
||||
}
|
||||
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=@PROJECT_NAME@
|
||||
Exec=/usr/bin/env systemctl start --u sunshine
|
||||
Version=1.0
|
||||
Actions=RunInTerminal;
|
||||
Categories=RemoteAccess;Network;
|
||||
Comment=@PROJECT_DESCRIPTION@
|
||||
Exec=/usr/bin/env systemctl start --u sunshine
|
||||
Icon=@SUNSHINE_DESKTOP_ICON@
|
||||
Keywords=gamestream;stream;moonlight;remote play;
|
||||
Categories=AudioVideo;Network;RemoteAccess;
|
||||
Actions=RunInTerminal;
|
||||
Name=@PROJECT_NAME@
|
||||
Type=Application
|
||||
Version=1.0
|
||||
|
||||
[Desktop Action RunInTerminal]
|
||||
Name=Run in Terminal
|
||||
Exec=gio launch @CMAKE_INSTALL_FULL_DATAROOTDIR@/applications/@PROJECT_FQDN@.terminal.desktop
|
||||
Icon=application-x-executable
|
||||
Exec=gio launch @CMAKE_INSTALL_FULL_DATAROOTDIR@/applications/sunshine_terminal.desktop
|
||||
Name=Run in Terminal
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="desktop-application">
|
||||
<component type="desktop">
|
||||
<id>@PROJECT_FQDN@</id>
|
||||
|
||||
<name>@CMAKE_PROJECT_NAME@</name>
|
||||
<name>@PROJECT_NAME@</name>
|
||||
<summary>@PROJECT_BRIEF_DESCRIPTION@</summary>
|
||||
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
@@ -15,39 +15,49 @@
|
||||
<control>gamepad</control>
|
||||
</supports>
|
||||
|
||||
<url type="bugtracker">https://github.com/LizardByte/Sunshine/issues</url>
|
||||
<url type="homepage">@PROJECT_HOMEPAGE_URL@</url>
|
||||
<url type="bugtracker">https://github.com/LizardByte/Sunshine/issues</url>
|
||||
<url type="faq">https://docs.lizardbyte.dev/projects/sunshine/latest/md_docs_2troubleshooting.html</url>
|
||||
<url type="help">https://docs.lizardbyte.dev/projects/sunshine</url>
|
||||
<url type="donation">https://app.lizardbyte.dev/#Donate</url>
|
||||
<url type="contact">https://app.lizardbyte.dev/support</url>
|
||||
<url type="translate">https://translate.lizardbyte.dev</url>
|
||||
<url type="contribute">https://docs.lizardbyte.dev</url>
|
||||
<url type="vcs-browser">https://github.com/LizardByte/Sunshine</url>
|
||||
<url type="contact">https://app.lizardbyte.dev/support</url>
|
||||
|
||||
<description>
|
||||
<p>
|
||||
@PROJECT_LONG_DESCRIPTION@
|
||||
</p>
|
||||
|
||||
<p>NOTE: Sunshine requires additional installation steps.</p>
|
||||
<p>NOTE: Sunshine requires additional installation steps (Flatpak).</p>
|
||||
<p>
|
||||
<code>flatpak run --command=additional-install.sh @PROJECT_FQDN@</code>
|
||||
</p>
|
||||
<p>NOTE: Sunshine uses a self-signed certificate. The web browser will report it as not secure, but it is safe.</p>
|
||||
<p>NOTE: KMS Grab (Optional)</p>
|
||||
<p>NOTE: KMS Grab (Flatpak)</p>
|
||||
<p>
|
||||
<code>sudo -i PULSE_SERVER=unix:/run/user/$(id -u $whoami)/pulse/native flatpak run @PROJECT_FQDN@</code>
|
||||
</p>
|
||||
</description>
|
||||
|
||||
<releases>
|
||||
<release version="@PROJECT_VERSION@" date="1990-01-01"></release>
|
||||
<release version="@PROJECT_VERSION@" date="@PROJECT_YEAR@-@PROJECT_MONTH@-@PROJECT_DAY@">
|
||||
<description>
|
||||
<p>
|
||||
See the full changelog on GitHub
|
||||
|
||||
<!-- changelog -->
|
||||
</p>
|
||||
</description>
|
||||
</release>
|
||||
</releases>
|
||||
|
||||
<developer_name>LizardByte</developer_name>
|
||||
<developer id="dev.lizardbyte">
|
||||
<name>LizardByte</name>
|
||||
</developer>
|
||||
<screenshots>
|
||||
<screenshot type="default">
|
||||
<image>https://app.lizardbyte.dev/Sunshine/assets/img/banners/AdobeStock_305732536_1920x1280.jpg</image>
|
||||
<caption>Sunshine</caption>
|
||||
<image>https://app.lizardbyte.dev/Sunshine/assets/img/screenshots/01-sunshine-welcome-page.png</image>
|
||||
<caption>Sunshine welcome page</caption>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
<content_rating type="oars-1.0">
|
||||
@@ -15,8 +15,11 @@ License: GPLv3-only
|
||||
URL: https://github.com/LizardByte/Sunshine
|
||||
Source0: tarball.tar.gz
|
||||
|
||||
BuildRequires: appstream
|
||||
# BuildRequires: boost-devel >= 1.86.0
|
||||
BuildRequires: cmake >= 3.25.0
|
||||
BuildRequires: desktop-file-utils
|
||||
BuildRequires: libappstream-glib
|
||||
BuildRequires: libayatana-appindicator3-devel
|
||||
BuildRequires: libcap-devel
|
||||
BuildRequires: libcurl-devel
|
||||
@@ -94,9 +97,6 @@ tar -xzf %{SOURCE0} -C %{_builddir}/Sunshine
|
||||
# list directory
|
||||
ls -a %{_builddir}/Sunshine
|
||||
|
||||
# patches
|
||||
%autopatch -p1
|
||||
|
||||
%build
|
||||
# exit on error
|
||||
set -e
|
||||
@@ -197,6 +197,11 @@ cmake "${cmake_args[@]}"
|
||||
make -j$(nproc) -C "%{_builddir}/Sunshine/build"
|
||||
|
||||
%check
|
||||
# validate the metainfo file
|
||||
appstreamcli validate %{buildroot}%{_metainfodir}/*.metainfo.xml
|
||||
appstream-util validate %{buildroot}%{_metainfodir}/*.metainfo.xml
|
||||
desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop
|
||||
|
||||
# run tests
|
||||
cd %{_builddir}/Sunshine/build
|
||||
xvfb-run ./tests/test_sunshine
|
||||
@@ -252,14 +257,14 @@ rm -f /usr/lib/modules-load.d/uhid.conf
|
||||
%{_modulesloaddir}/uhid.conf
|
||||
|
||||
# Desktop entries
|
||||
%{_datadir}/applications/sunshine*.desktop
|
||||
%{_datadir}/applications/*.desktop
|
||||
|
||||
# Icons
|
||||
%{_datadir}/icons/hicolor/scalable/apps/sunshine.svg
|
||||
%{_datadir}/icons/hicolor/scalable/status/sunshine*.svg
|
||||
|
||||
# Metainfo
|
||||
%{_datadir}/metainfo/sunshine.appdata.xml
|
||||
%{_datadir}/metainfo/*.metainfo.xml
|
||||
|
||||
# Assets
|
||||
%{_datadir}/sunshine/**
|
||||
|
||||
Submodule packaging/linux/flatpak/deps/flatpak-builder-tools updated: bf91cb0bee...d2fa57ab89
Submodule packaging/linux/flatpak/deps/shared-modules updated: 1f8e591b26...b63062b3cd
@@ -1,5 +1,5 @@
|
||||
[Desktop Entry]
|
||||
Categories=AudioVideo;Network;RemoteAccess;
|
||||
Categories=RemoteAccess;Network;
|
||||
Comment=@PROJECT_DESCRIPTION@
|
||||
Exec=sunshine.sh
|
||||
Icon=@SUNSHINE_DESKTOP_ICON@
|
||||
@@ -1,8 +1,9 @@
|
||||
{
|
||||
"dev.lizardbyte.app.Sunshine": [
|
||||
"appstream-missing-screenshots",
|
||||
"appstream-external-screenshot-url",
|
||||
"appstream-screenshots-not-mirrored-in-ostree",
|
||||
"external-gitmodule-url-found",
|
||||
"finish-args-flatpak-spawn-access"
|
||||
"finish-args-flatpak-spawn-access",
|
||||
"finish-args-home-filesystem-access"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -32,15 +32,12 @@
|
||||
"sources": [
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://salsa.debian.org/utopia-team/avahi.git",
|
||||
"commit": "1412c015d348166d58ea9c192239b00769eae24e",
|
||||
"tag": "debian/0.8-13",
|
||||
"url": "https://github.com/avahi/avahi.git",
|
||||
"commit": "f060abee2807c943821d88839c013ce15db17b58",
|
||||
"tag": "v0.8",
|
||||
"x-checker-data": {
|
||||
"type": "git",
|
||||
"tag-pattern": "^debian\\/(\\d.+)$",
|
||||
"versions": {
|
||||
"<": "0.9"
|
||||
}
|
||||
"tag-pattern": "^v([\\d.]+)$"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -5,22 +5,24 @@
|
||||
"-Ddocumentation=disabled",
|
||||
"-Dtests=disabled"
|
||||
],
|
||||
"cleanup": [
|
||||
"/bin"
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://salsa.debian.org/debian/libevdev.git",
|
||||
"commit": "1aa7baa233d6df4cee6a66fbc61bb5ffc8b6e88d",
|
||||
"tag": "debian/1.13.0+dfsg-1",
|
||||
"url": "https://github.com/LizardByte-infrastructure/libevdev.git",
|
||||
"commit": "ac0056961c3332a260db063ab4fccc7747638a1d",
|
||||
"tag": "libevdev-1.13.4",
|
||||
"x-checker-data": {
|
||||
"type": "git",
|
||||
"tag-pattern": "^debian\\/(\\d.\\d+\\.\\d+)",
|
||||
"versions": {
|
||||
"<": "1.13.1"
|
||||
}
|
||||
"type": "anitya",
|
||||
"project-id": 20540,
|
||||
"stable-only": true,
|
||||
"tag-template": "libevdev-$version"
|
||||
}
|
||||
}
|
||||
],
|
||||
"cleanup": [
|
||||
"/bin",
|
||||
"/include",
|
||||
"/lib/pkgconfig",
|
||||
"/share"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -11,15 +11,12 @@
|
||||
"sources": [
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://salsa.debian.org/gnome-team/libnotify.git",
|
||||
"commit": "ccf2f62ef0a4b264dd4eff32cab70a3e213ceb1a",
|
||||
"tag": "debian/0.8.1-1",
|
||||
"url": "https://github.com/LizardByte-infrastructure/libnotify.git",
|
||||
"commit": "131aad01ff5f563b4863becbb6ed84dac6e75d5a",
|
||||
"tag": "0.8.6",
|
||||
"x-checker-data": {
|
||||
"type": "git",
|
||||
"tag-pattern": "^debian\\/(\\d.+)$",
|
||||
"versions": {
|
||||
"<": "0.8.2"
|
||||
}
|
||||
"tag-pattern": "^([\\d.]+)$"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -1,25 +1,33 @@
|
||||
{
|
||||
"name": "miniupnpc",
|
||||
"buildsystem": "cmake-ninja",
|
||||
"builddir": true,
|
||||
"config-opts": [
|
||||
"-DCMAKE_BUILD_TYPE=Release",
|
||||
"-DUPNPC_BUILD_SAMPLE=OFF",
|
||||
"-DCMAKE_BUILD_TYPE=RelWithDebInfo",
|
||||
"-DUPNPC_BUILD_STATIC=OFF",
|
||||
"-DUPNPC_BUILD_SHARED=ON",
|
||||
"-DUPNPC_BUILD_TESTS=OFF"
|
||||
"-DUPNPC_BUILD_TESTS=OFF",
|
||||
"-DUPNPC_BUILD_SAMPLE=OFF"
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://salsa.debian.org/miniupnp-team/miniupnpc.git",
|
||||
"commit": "c5fe3aa794e92a503cecec6a4071eb6d310b4e42",
|
||||
"tag": "debian/2.2.4-1",
|
||||
"url": "https://miniupnp.tuxfamily.org/files/miniupnpc-2.3.3.tar.gz",
|
||||
"sha256": "d52a0afa614ad6c088cc9ddff1ae7d29c8c595ac5fdd321170a05f41e634bd1a",
|
||||
"x-checker-data": {
|
||||
"type": "git",
|
||||
"tag-pattern": "^debian\\/(\\d.+)$",
|
||||
"versions": {
|
||||
"<": "2.2.5"
|
||||
}
|
||||
}
|
||||
"type": "anitya",
|
||||
"project-id": 1986,
|
||||
"stable-only": true,
|
||||
"url-template": "https://miniupnp.tuxfamily.org/files/miniupnpc-$version.tar.gz"
|
||||
},
|
||||
"type": "archive"
|
||||
}
|
||||
],
|
||||
"cleanup": [
|
||||
"/share/man",
|
||||
"/lib/pkgconfig",
|
||||
"/lib/libminiupnpc.so",
|
||||
"/lib/cmake",
|
||||
"/include",
|
||||
"/bin/external-ip.sh"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,22 +1,24 @@
|
||||
{
|
||||
"name": "numactl",
|
||||
"buildsystem": "autotools",
|
||||
"cleanup": [
|
||||
"/bin"
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://salsa.debian.org/debian/numactl.git",
|
||||
"commit": "640bb34497702f9aaeb8af1b491f32b91d03ec80",
|
||||
"tag": "debian/2.0.16-1",
|
||||
"url": "https://github.com/numactl/numactl.git",
|
||||
"tag": "v2.0.19",
|
||||
"commit": "3bc85e37d5a30da6790cb7e8bb488bb8f679170f",
|
||||
"x-checker-data": {
|
||||
"type": "git",
|
||||
"tag-pattern": "^debian\\/(\\d.+)$",
|
||||
"versions": {
|
||||
"<": "2.0.17"
|
||||
}
|
||||
"tag-pattern": "^v([\\d.]+)$"
|
||||
}
|
||||
}
|
||||
],
|
||||
"rm-configure": true,
|
||||
"cleanup": [
|
||||
"/include",
|
||||
"/lib/pkgconfig",
|
||||
"/lib/*.a",
|
||||
"/lib/*.la",
|
||||
"/lib/*.so",
|
||||
"/share/man"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
|
||||
# User Service
|
||||
mkdir -p ~/.config/systemd/user
|
||||
cp /app/share/sunshine/systemd/user/sunshine.service $HOME/.config/systemd/user/sunshine.service
|
||||
echo Sunshine User Service has been installed.
|
||||
echo Use [systemctl --user enable sunshine] once to autostart Sunshine on login.
|
||||
cp "/app/share/sunshine/systemd/user/sunshine.service" "$HOME/.config/systemd/user/sunshine.service"
|
||||
echo "Sunshine User Service has been installed."
|
||||
echo "Use [systemctl --user enable sunshine] once to autostart Sunshine on login."
|
||||
|
||||
# Udev rule
|
||||
UDEV=$(cat /app/share/sunshine/udev/rules.d/60-sunshine.rules)
|
||||
echo Configuring mouse permission.
|
||||
echo "Configuring mouse permission."
|
||||
flatpak-spawn --host pkexec sh -c "echo '$UDEV' > /etc/udev/rules.d/60-sunshine.rules"
|
||||
echo Restart computer for mouse permission to take effect.
|
||||
echo "Restart computer for mouse permission to take effect."
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
# User Service
|
||||
systemctl --user stop sunshine
|
||||
rm $HOME/.config/systemd/user/sunshine.service
|
||||
rm "$HOME/.config/systemd/user/sunshine.service"
|
||||
systemctl --user daemon-reload
|
||||
echo Sunshine User Service has been removed.
|
||||
echo "Sunshine User Service has been removed."
|
||||
|
||||
# Udev rule
|
||||
flatpak-spawn --host pkexec sh -c "rm /etc/udev/rules.d/60-sunshine.rules"
|
||||
echo Input rules removed. Restart computer to take effect.
|
||||
echo "Input rules removed. Restart computer to take effect."
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="desktop">
|
||||
<id>@PROJECT_NAME@.desktop</id>
|
||||
<metadata_license>@PROJECT_LICENSE@</metadata_license>
|
||||
<project_license>@PROJECT_LICENSE@</project_license>
|
||||
<name>@PROJECT_NAME@</name>
|
||||
<url type="homepage">@CMAKE_PROJECT_HOMEPAGE_URL@</url>
|
||||
<summary>@PROJECT_BRIEF_DESCRIPTION@</summary>
|
||||
<description>
|
||||
<p>
|
||||
@PROJECT_LONG_DESCRIPTION@
|
||||
</p>
|
||||
</description>
|
||||
<screenshots>
|
||||
<screenshot type="default">
|
||||
<image>https://app.lizardbyte.dev/Sunshine/assets/images/AdobeStock_305732536_1920x1280.jpg</image>
|
||||
<caption>Sunshine</caption>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
</component>
|
||||
@@ -6,7 +6,7 @@ class @PROJECT_NAME@ < Formula
|
||||
homepage "@PROJECT_HOMEPAGE_URL@"
|
||||
url "@GITHUB_CLONE_URL@",
|
||||
tag: "@GITHUB_TAG@"
|
||||
version "@FORMULA_VERSION@"
|
||||
version "@BUILD_VERSION@"
|
||||
license all_of: ["GPL-3.0-only"]
|
||||
head "@GITHUB_CLONE_URL@", branch: "@GITHUB_DEFAULT_BRANCH@"
|
||||
|
||||
@@ -29,9 +29,8 @@ class @PROJECT_NAME@ < Formula
|
||||
depends_on "cmake" => :build
|
||||
depends_on "doxygen" => :build
|
||||
depends_on "graphviz" => :build
|
||||
depends_on "ninja" => :build
|
||||
depends_on "node" => :build
|
||||
depends_on "pkg-config" => :build
|
||||
depends_on "pkgconf" => :build
|
||||
depends_on "curl"
|
||||
depends_on "miniupnpc"
|
||||
depends_on "openssl"
|
||||
@@ -39,25 +38,8 @@ class @PROJECT_NAME@ < Formula
|
||||
depends_on "icu4c" => :recommended
|
||||
|
||||
on_linux do
|
||||
# the "build" dependencies are for libayatana-appindicator
|
||||
depends_on "at-spi2-core" => :build
|
||||
depends_on "cairo" => :build
|
||||
depends_on "fontconfig" => :build
|
||||
depends_on "freetype" => :build
|
||||
depends_on "fribidi" => :build
|
||||
depends_on "gettext" => :build
|
||||
depends_on "gobject-introspection" => :build
|
||||
depends_on "graphite2" => :build
|
||||
depends_on "gtk+3" => :build
|
||||
depends_on "harfbuzz" => :build
|
||||
depends_on "intltool" => :build
|
||||
depends_on "libepoxy" => :build
|
||||
depends_on "libxdamage" => :build
|
||||
depends_on "libxkbcommon" => :build
|
||||
depends_on "pango" => :build
|
||||
depends_on "perl" => :build
|
||||
depends_on "pixman" => :build
|
||||
depends_on "avahi"
|
||||
depends_on "libayatana-appindicator"
|
||||
depends_on "libcap"
|
||||
depends_on "libdrm"
|
||||
depends_on "libnotify"
|
||||
@@ -75,128 +57,6 @@ class @PROJECT_NAME@ < Formula
|
||||
depends_on "pulseaudio"
|
||||
depends_on "systemd"
|
||||
depends_on "wayland"
|
||||
|
||||
# resources that do not have brew packages
|
||||
resource "libayatana-appindicator" do
|
||||
url "https://github.com/AyatanaIndicators/libayatana-appindicator/archive/refs/tags/0.5.94.tar.gz"
|
||||
sha256 "884a6bc77994c0b58c961613ca4c4b974dc91aa0f804e70e92f38a542d0d0f90"
|
||||
end
|
||||
|
||||
resource "libdbusmenu" do
|
||||
url "https://launchpad.net/libdbusmenu/16.04/16.04.0/+download/libdbusmenu-16.04.0.tar.gz"
|
||||
sha256 "b9cc4a2acd74509435892823607d966d424bd9ad5d0b00938f27240a1bfa878a"
|
||||
|
||||
patch 'From 729546c51806a1b3ea6cb6efb7a115b1baa811f1 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
|
||||
Date: Mon, 18 Nov 2019 19:58:53 +0100
|
||||
Subject: [PATCH 1/1] Fix HAVE_VALGRIND AM_CONDITIONAL
|
||||
|
||||
The AM_CONDITIONAL should also be run with --disable-tests, otherwise
|
||||
HAVE_VALGRIND is undefined.
|
||||
---
|
||||
configure | 4 ++--
|
||||
configure.ac | 2 +-
|
||||
2 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/configure b/configure
|
||||
index 831a3bb..8913b9b 100644
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -14801,6 +14801,8 @@ else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
have_valgrind=yes
|
||||
+fi
|
||||
+
|
||||
fi
|
||||
if test "x$have_valgrind" = "xyes"; then
|
||||
HAVE_VALGRIND_TRUE=
|
||||
@@ -14811,8 +14813,6 @@ else
|
||||
fi
|
||||
|
||||
|
||||
-fi
|
||||
-
|
||||
|
||||
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index ace54d1..cbd38a6 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -120,8 +120,8 @@ PKG_CHECK_MODULES(DBUSMENUTESTS, json-glib-1.0 >= $JSON_GLIB_REQUIRED_VERSION
|
||||
[have_tests=yes]
|
||||
)
|
||||
PKG_CHECK_MODULES(DBUSMENUTESTSVALGRIND, valgrind, have_valgrind=yes, have_valgrind=no)
|
||||
-AM_CONDITIONAL([HAVE_VALGRIND], [test "x$have_valgrind" = "xyes"])
|
||||
])
|
||||
+AM_CONDITIONAL([HAVE_VALGRIND], [test "x$have_valgrind" = "xyes"])
|
||||
|
||||
AC_SUBST(DBUSMENUTESTS_CFLAGS)
|
||||
AC_SUBST(DBUSMENUTESTS_LIBS)
|
||||
--
|
||||
2.46.2
|
||||
|
||||
|
||||
'
|
||||
end
|
||||
|
||||
resource "ayatana-ido" do
|
||||
url "https://github.com/AyatanaIndicators/ayatana-ido/archive/refs/tags/0.10.4.tar.gz"
|
||||
sha256 "bd59abd5f1314e411d0d55ce3643e91cef633271f58126be529de5fb71c5ab38"
|
||||
|
||||
patch 'From 8a09e6ad33c58c017c0c8fd756da036fc39428ea Mon Sep 17 00:00:00 2001
|
||||
From: Alexander Koskovich <akoskovich@pm.me>
|
||||
Date: Sun, 29 Sep 2024 13:47:54 -0400
|
||||
Subject: [PATCH 1/1] Make introspection configurable
|
||||
|
||||
---
|
||||
CMakeLists.txt | 1 +
|
||||
src/CMakeLists.txt | 4 ++++
|
||||
2 files changed, 5 insertions(+)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 0e13fcd..f3e9ec0 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -12,6 +12,7 @@ endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
option(ENABLE_TESTS "Enable all tests and checks" OFF)
|
||||
option(ENABLE_COVERAGE "Enable coverage reports (includes enabling all tests and checks)" OFF)
|
||||
option(ENABLE_WERROR "Treat all build warnings as errors" OFF)
|
||||
+option(ENABLE_INTROSPECTION "Enable introspection" ON)
|
||||
|
||||
if(ENABLE_COVERAGE)
|
||||
set(ENABLE_TESTS ON)
|
||||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
||||
index 5b3638d..aca9481 100644
|
||||
--- a/src/CMakeLists.txt
|
||||
+++ b/src/CMakeLists.txt
|
||||
@@ -108,6 +108,8 @@ install(TARGETS "ayatana-ido3-0.4" LIBRARY DESTINATION "${CMAKE_INSTALL_FULL_LIB
|
||||
|
||||
# AyatanaIdo3-0.4.gir
|
||||
|
||||
+if (ENABLE_INTROSPECTION)
|
||||
+
|
||||
find_package(GObjectIntrospection REQUIRED QUIET)
|
||||
|
||||
if (INTROSPECTION_FOUND)
|
||||
@@ -183,3 +185,5 @@ if (INTROSPECTION_FOUND)
|
||||
endif ()
|
||||
|
||||
endif ()
|
||||
+
|
||||
+endif ()
|
||||
--
|
||||
2.46.2
|
||||
|
||||
|
||||
'
|
||||
end
|
||||
|
||||
resource "libayatana-indicator" do
|
||||
url "https://github.com/AyatanaIndicators/libayatana-indicator/archive/refs/tags/0.9.4.tar.gz"
|
||||
sha256 "a18d3c682e29afd77db24366f8475b26bda22b0e16ff569a2ec71cd6eb4eac95"
|
||||
end
|
||||
end
|
||||
|
||||
def install
|
||||
@@ -206,7 +66,7 @@ index 5b3638d..aca9481 100644
|
||||
|
||||
args = %W[
|
||||
-DBUILD_WERROR=ON
|
||||
-DCMAKE_CXX_STANDARD=20
|
||||
-DCMAKE_CXX_STANDARD=23
|
||||
-DCMAKE_INSTALL_PREFIX=#{prefix}
|
||||
-DHOMEBREW_ALLOW_FETCHCONTENT=ON
|
||||
-DOPENSSL_ROOT_DIR=#{Formula["openssl"].opt_prefix}
|
||||
@@ -248,59 +108,6 @@ index 5b3638d..aca9481 100644
|
||||
args << "-DCUDA_FAIL_ON_MISSING=OFF" if OS.linux?
|
||||
args << "-DSUNSHINE_ENABLE_TRAY=OFF" if OS.mac?
|
||||
|
||||
# Handle system tray on Linux
|
||||
if OS.linux?
|
||||
# Build and install libayatana components
|
||||
|
||||
# Build libdbusmenu
|
||||
resource("libdbusmenu").stage do
|
||||
system "./configure",
|
||||
"--prefix=#{prefix}",
|
||||
"--with-gtk=3",
|
||||
"--disable-dumper",
|
||||
"--disable-static",
|
||||
"--disable-tests",
|
||||
"--disable-gtk-doc",
|
||||
"--enable-introspection=no",
|
||||
"--disable-vala"
|
||||
system "make", "install"
|
||||
end
|
||||
|
||||
# Build ayatana-ido
|
||||
resource("ayatana-ido").stage do
|
||||
system "cmake", "-S", ".", "-B", "build", "-G", "Ninja",
|
||||
"-DCMAKE_INSTALL_PREFIX=#{prefix}",
|
||||
"-DENABLE_INTROSPECTION=OFF",
|
||||
*std_cmake_args
|
||||
system "ninja", "-C", "build"
|
||||
system "ninja", "-C", "build", "install"
|
||||
end
|
||||
|
||||
# Build libayatana-indicator
|
||||
resource("libayatana-indicator").stage do
|
||||
ENV.append_path "PKG_CONFIG_PATH", "#{lib}/pkgconfig"
|
||||
ENV.append "LDFLAGS", "-L#{lib}"
|
||||
|
||||
system "cmake", "-S", ".", "-B", "build", "-G", "Ninja",
|
||||
"-DCMAKE_INSTALL_PREFIX=#{prefix}",
|
||||
*std_cmake_args
|
||||
system "ninja", "-C", "build"
|
||||
system "ninja", "-C", "build", "install"
|
||||
end
|
||||
|
||||
# Build libayatana-appindicator
|
||||
resource("libayatana-appindicator").stage do
|
||||
system "cmake", "-S", ".", "-B", "build", "-G", "Ninja",
|
||||
"-DCMAKE_INSTALL_PREFIX=#{prefix}",
|
||||
"-DENABLE_BINDINGS_MONO=OFF",
|
||||
"-DENABLE_BINDINGS_VALA=OFF",
|
||||
"-DENABLE_GTKDOC=OFF",
|
||||
*std_cmake_args
|
||||
system "ninja", "-C", "build"
|
||||
system "ninja", "-C", "build", "install"
|
||||
end
|
||||
end
|
||||
|
||||
system "cmake", "-S", ".", "-B", "build", "-G", "Unix Makefiles",
|
||||
*std_cmake_args,
|
||||
*args
|
||||
@@ -319,31 +126,31 @@ index 5b3638d..aca9481 100644
|
||||
run [opt_bin/"sunshine", "~/.config/sunshine/sunshine.conf"]
|
||||
end
|
||||
|
||||
def caveats
|
||||
caveats_message = <<~EOS
|
||||
Thanks for installing @PROJECT_NAME@!
|
||||
|
||||
To get started, review the documentation at:
|
||||
https://docs.lizardbyte.dev/projects/sunshine
|
||||
EOS
|
||||
|
||||
def post_install
|
||||
if OS.linux?
|
||||
caveats_message += <<~EOS
|
||||
opoo <<~EOS
|
||||
ATTENTION: To complete installation, you must run the following command:
|
||||
`sudo #{bin}/postinst`
|
||||
EOS
|
||||
end
|
||||
|
||||
if OS.mac?
|
||||
caveats_message += <<~EOS
|
||||
opoo <<~EOS
|
||||
Sunshine can only access microphones on macOS due to system limitations.
|
||||
To stream system audio use "Soundflower" or "BlackHole".
|
||||
|
||||
Gamepads are not currently supported on macOS.
|
||||
EOS
|
||||
end
|
||||
end
|
||||
|
||||
caveats_message
|
||||
def caveats
|
||||
<<~EOS
|
||||
Thanks for installing @PROJECT_NAME@!
|
||||
|
||||
To get started, review the documentation at:
|
||||
https://docs.lizardbyte.dev/projects/sunshine
|
||||
EOS
|
||||
end
|
||||
|
||||
test do
|
||||
|
||||
@@ -25,6 +25,7 @@ year = datetime.datetime.now().year
|
||||
# target locales
|
||||
target_locales = [
|
||||
'bg', # Bulgarian
|
||||
'cs', # Czech
|
||||
'de', # German
|
||||
'en', # English
|
||||
'en_GB', # English (United Kingdom)
|
||||
@@ -42,6 +43,7 @@ target_locales = [
|
||||
'tr', # Turkish
|
||||
'uk', # Ukrainian
|
||||
'zh', # Chinese
|
||||
'zh_TW', # Chinese (Traditional)
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -1,61 +1,63 @@
|
||||
#!/bin/bash
|
||||
|
||||
if ! [ -x "$(command -v ./go-png2ico)" ]; then
|
||||
echo "./go-png2ico not found"
|
||||
echo "download the executable from https://github.com/J-Siu/go-png2ico"
|
||||
echo "and drop it in this folder"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! [ -x "$(command -v ./oxipng)" ]; then
|
||||
echo "./oxipng executable not found"
|
||||
echo "download the executable from https://github.com/shssoichiro/oxipng"
|
||||
echo "and drop it in this folder"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! [ -x "$(command -v inkscape)" ]; then
|
||||
echo "inkscape executable not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
icon_base_sizes=(16 64)
|
||||
icon_sizes_keys=() # associative array to prevent duplicates
|
||||
icon_sizes_keys[256]=1
|
||||
|
||||
for icon_base_size in ${icon_base_sizes[@]}; do
|
||||
# increment in 25% till 400%
|
||||
icon_size_increment=$((icon_base_size / 4))
|
||||
for ((i = 0; i <= 12; i++)); do
|
||||
icon_sizes_keys[$((icon_base_size + i * icon_size_increment))]=1
|
||||
done
|
||||
done
|
||||
|
||||
# convert to normal array
|
||||
icon_sizes=${!icon_sizes_keys[@]}
|
||||
|
||||
echo "using icon sizes:"
|
||||
echo ${icon_sizes[@]}
|
||||
|
||||
src_vectors=("../../src_assets/common/assets/web/public/images/sunshine-locked.svg"
|
||||
"../../src_assets/common/assets/web/public/images/sunshine-pausing.svg"
|
||||
"../../src_assets/common/assets/web/public/images/sunshine-playing.svg"
|
||||
"../../sunshine.svg")
|
||||
|
||||
echo "using sources vectors:"
|
||||
echo ${src_vectors[@]}
|
||||
|
||||
for src_vector in ${src_vectors[@]}; do
|
||||
file_name=`basename "$src_vector" .svg`
|
||||
png_files=()
|
||||
for icon_size in ${icon_sizes[@]}; do
|
||||
png_file="${file_name}${icon_size}.png"
|
||||
echo "converting ${png_file}"
|
||||
inkscape -w $icon_size -h $icon_size "$src_vector" --export-filename "${png_file}" &&
|
||||
./oxipng -o max --strip safe --alpha "${png_file}" &&
|
||||
png_files+=("${png_file}")
|
||||
done
|
||||
|
||||
echo "packing ${file_name}.ico"
|
||||
./go-png2ico "${png_files[@]}" "${file_name}.ico"
|
||||
done
|
||||
#!/bin/bash
|
||||
|
||||
if ! [ -x "$(command -v ./go-png2ico)" ]; then
|
||||
echo "./go-png2ico not found"
|
||||
echo "download the executable from https://github.com/J-Siu/go-png2ico"
|
||||
echo "and drop it in this folder"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! [ -x "$(command -v ./oxipng)" ]; then
|
||||
echo "./oxipng executable not found"
|
||||
echo "download the executable from https://github.com/shssoichiro/oxipng"
|
||||
echo "and drop it in this folder"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! [ -x "$(command -v inkscape)" ]; then
|
||||
echo "inkscape executable not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
icon_base_sizes=(16 64)
|
||||
icon_sizes_keys=() # associative array to prevent duplicates
|
||||
icon_sizes_keys[256]=1
|
||||
|
||||
for icon_base_size in "${icon_base_sizes[@]}"; do
|
||||
# increment in 25% till 400%
|
||||
icon_size_increment=$((icon_base_size / 4))
|
||||
for ((i = 0; i <= 12; i++)); do
|
||||
icon_sizes_keys[icon_base_size + i * icon_size_increment]=1
|
||||
done
|
||||
done
|
||||
|
||||
# convert to normal array
|
||||
icon_sizes=("${!icon_sizes_keys[@]}")
|
||||
|
||||
echo "using icon sizes:"
|
||||
# shellcheck disable=SC2068 # intentionally word split
|
||||
echo ${icon_sizes[@]}
|
||||
|
||||
src_vectors=("../../src_assets/common/assets/web/public/images/sunshine-locked.svg"
|
||||
"../../src_assets/common/assets/web/public/images/sunshine-pausing.svg"
|
||||
"../../src_assets/common/assets/web/public/images/sunshine-playing.svg"
|
||||
"../../sunshine.svg")
|
||||
|
||||
echo "using sources vectors:"
|
||||
# shellcheck disable=SC2068 # intentionally word split
|
||||
echo ${src_vectors[@]}
|
||||
|
||||
for src_vector in "${src_vectors[@]}"; do
|
||||
file_name=$(basename "${src_vector}" .svg)
|
||||
png_files=()
|
||||
for icon_size in "${icon_sizes[@]}"; do
|
||||
png_file="${file_name}${icon_size}.png"
|
||||
echo "converting ${png_file}"
|
||||
inkscape -w "${icon_size}" -h "${icon_size}" "${src_vector}" --export-filename "${png_file}" &&
|
||||
./oxipng -o max --strip safe --alpha "${png_file}" &&
|
||||
png_files+=("${png_file}")
|
||||
done
|
||||
|
||||
echo "packing ${file_name}.ico"
|
||||
./go-png2ico "${png_files[@]}" "${file_name}.ico"
|
||||
done
|
||||
|
||||
@@ -96,9 +96,11 @@ function add_arch_deps() {
|
||||
'base-devel'
|
||||
'cmake'
|
||||
'curl'
|
||||
'doxygen'
|
||||
"gcc${gcc_version}"
|
||||
"gcc${gcc_version}-libs"
|
||||
'git'
|
||||
'graphviz'
|
||||
'libayatana-appindicator'
|
||||
'libcap'
|
||||
'libdrm'
|
||||
@@ -138,9 +140,12 @@ function add_arch_deps() {
|
||||
|
||||
function add_debian_based_deps() {
|
||||
dependencies+=(
|
||||
"appstream"
|
||||
"appstream-util"
|
||||
"bison" # required if we need to compile doxygen
|
||||
"build-essential"
|
||||
"cmake"
|
||||
"desktop-file-utils"
|
||||
"doxygen"
|
||||
"flex" # required if we need to compile doxygen
|
||||
"gcc-${gcc_version}"
|
||||
@@ -201,13 +206,16 @@ function add_ubuntu_deps() {
|
||||
|
||||
function add_fedora_deps() {
|
||||
dependencies+=(
|
||||
"appstream"
|
||||
"cmake"
|
||||
"desktop-file-utils"
|
||||
"doxygen"
|
||||
"gcc${gcc_version}"
|
||||
"gcc${gcc_version}-c++"
|
||||
"git"
|
||||
"graphviz"
|
||||
"libappindicator-gtk3-devel"
|
||||
"libappstream-glib"
|
||||
"libcap-devel"
|
||||
"libcurl-devel"
|
||||
"libdrm-devel"
|
||||
@@ -386,7 +394,7 @@ function run_install() {
|
||||
"gcc-ranlib"
|
||||
)
|
||||
|
||||
#set gcc version based on distros
|
||||
#set gcc version based on distros
|
||||
if [ "$distro" == "arch" ]; then
|
||||
export CC=gcc-14
|
||||
export CXX=g++-14
|
||||
@@ -394,7 +402,7 @@ function run_install() {
|
||||
for file in "${gcc_alternative_files[@]}"; do
|
||||
file_path="/etc/alternatives/$file"
|
||||
if [ -e "$file_path" ]; then
|
||||
mv "$file_path" "$file_path.bak"
|
||||
${sudo_cmd} mv "$file_path" "$file_path.bak"
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -433,12 +441,14 @@ function run_install() {
|
||||
echo "Compiling doxygen"
|
||||
doxygen_url="https://github.com/doxygen/doxygen/releases/download/Release_${_doxygen_min}/doxygen-${doxygen_min}.src.tar.gz"
|
||||
echo "doxygen url: ${doxygen_url}"
|
||||
wget "$doxygen_url" --progress=bar:force:noscroll -q --show-progress -O "${build_dir}/doxygen.tar.gz"
|
||||
tar -xzf "${build_dir}/doxygen.tar.gz"
|
||||
cd "doxygen-${doxygen_min}"
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -G="Ninja" -B="build" -S="."
|
||||
ninja -C "build" -j"${num_processors}"
|
||||
ninja -C "build" install
|
||||
pushd "${build_dir}"
|
||||
wget "$doxygen_url" --progress=bar:force:noscroll -q --show-progress -O "doxygen.tar.gz"
|
||||
tar -xzf "doxygen.tar.gz"
|
||||
cd "doxygen-${doxygen_min}"
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -G="Ninja" -B="build" -S="."
|
||||
ninja -C "build" -j"${num_processors}"
|
||||
${sudo_cmd} ninja -C "build" install
|
||||
popd
|
||||
else
|
||||
echo "Doxygen version not in range, skipping docs"
|
||||
cmake_args+=("-DBUILD_DOCS=OFF")
|
||||
@@ -450,6 +460,8 @@ function run_install() {
|
||||
nvm_url="https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh"
|
||||
echo "nvm url: ${nvm_url}"
|
||||
wget -qO- ${nvm_url} | bash
|
||||
|
||||
# shellcheck source=/dev/null # we don't care that shellcheck cannot find nvm.sh
|
||||
source "$HOME/.nvm/nvm.sh"
|
||||
nvm install node
|
||||
nvm use node
|
||||
@@ -460,6 +472,8 @@ function run_install() {
|
||||
install_cuda
|
||||
cmake_args+=("-DSUNSHINE_ENABLE_CUDA=ON")
|
||||
cmake_args+=("-DCMAKE_CUDA_COMPILER:PATH=$nvcc_path")
|
||||
else
|
||||
cmake_args+=("-DSUNSHINE_ENABLE_CUDA=OFF")
|
||||
fi
|
||||
|
||||
# Cmake stuff here
|
||||
@@ -467,6 +481,16 @@ function run_install() {
|
||||
echo "cmake args:"
|
||||
echo "${cmake_args[@]}"
|
||||
cmake "${cmake_args[@]}"
|
||||
|
||||
# Run appstream validation, etc.
|
||||
appstreamcli validate "build/dev.lizardbyte.app.Sunshine.metainfo.xml"
|
||||
appstream-util validate "build/dev.lizardbyte.app.Sunshine.metainfo.xml"
|
||||
desktop-file-validate "build/dev.lizardbyte.app.Sunshine.desktop"
|
||||
if [ "$appimage_build" == 0 ]; then
|
||||
desktop-file-validate "build/dev.lizardbyte.app.Sunshine.terminal.desktop"
|
||||
fi
|
||||
|
||||
# Build the project
|
||||
ninja -C "build"
|
||||
|
||||
# Create the package
|
||||
@@ -564,6 +588,15 @@ elif grep -q "Ubuntu 24.04" /etc/os-release; then
|
||||
cuda_build="520.61.05"
|
||||
gcc_version="11"
|
||||
nvm_node=0
|
||||
elif grep -q "Ubuntu 25.04" /etc/os-release; then
|
||||
distro="ubuntu"
|
||||
version="25.04"
|
||||
package_update_command="${sudo_cmd} apt-get update"
|
||||
package_install_command="${sudo_cmd} apt-get install -y"
|
||||
cuda_version="11.8.0"
|
||||
cuda_build="520.61.05"
|
||||
gcc_version="11"
|
||||
nvm_node=0
|
||||
else
|
||||
echo "Unsupported Distro or Version"
|
||||
exit 1
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include <shellapi.h>
|
||||
#endif
|
||||
|
||||
#ifndef __APPLE__
|
||||
#if !defined(__ANDROID__) && !defined(__APPLE__)
|
||||
// For NVENC legacy constants
|
||||
#include <ffnvcodec/nvEncodeAPI.h>
|
||||
#endif
|
||||
@@ -504,8 +504,8 @@ namespace config {
|
||||
{} // wa
|
||||
}, // display_device
|
||||
|
||||
1, // min_fps_factor
|
||||
0 // max_bitrate
|
||||
0, // max_bitrate
|
||||
0 // minimum_fps_target (0 = framerate)
|
||||
};
|
||||
|
||||
audio_t audio {
|
||||
@@ -1039,9 +1039,12 @@ namespace config {
|
||||
}
|
||||
|
||||
void apply_config(std::unordered_map<std::string, std::string> &&vars) {
|
||||
#ifndef __ANDROID__
|
||||
// TODO: Android can possibly support this
|
||||
if (!fs::exists(stream.file_apps.c_str())) {
|
||||
fs::copy_file(SUNSHINE_ASSETS_DIR "/apps.json", stream.file_apps);
|
||||
}
|
||||
#endif
|
||||
|
||||
for (auto &[name, val] : vars) {
|
||||
BOOST_LOG(info) << "config: '"sv << name << "' = "sv << val;
|
||||
@@ -1067,7 +1070,7 @@ namespace config {
|
||||
bool_f(vars, "nvenc_opengl_vulkan_on_dxgi", video.nv_opengl_vulkan_on_dxgi);
|
||||
bool_f(vars, "nvenc_latency_over_power", video.nv_sunshine_high_power_mode);
|
||||
|
||||
#ifndef __APPLE__
|
||||
#if !defined(__ANDROID__) && !defined(__APPLE__)
|
||||
video.nv_legacy.preset = video.nv.quality_preset + 11;
|
||||
video.nv_legacy.multipass = video.nv.two_pass == nvenc::nvenc_two_pass::quarter_resolution ? NV_ENC_TWO_PASS_QUARTER_RESOLUTION :
|
||||
video.nv.two_pass == nvenc::nvenc_two_pass::full_resolution ? NV_ENC_TWO_PASS_FULL_RESOLUTION :
|
||||
@@ -1143,8 +1146,8 @@ namespace config {
|
||||
video.dd.wa.hdr_toggle_delay = std::chrono::milliseconds {value};
|
||||
}
|
||||
|
||||
int_between_f(vars, "min_fps_factor", video.min_fps_factor, {1, 3});
|
||||
int_f(vars, "max_bitrate", video.max_bitrate);
|
||||
double_between_f(vars, "minimum_fps_target", video.minimum_fps_target, {0.0, 1000.0});
|
||||
|
||||
path_f(vars, "pkey", nvhttp.pkey);
|
||||
path_f(vars, "cert", nvhttp.cert);
|
||||
@@ -1240,6 +1243,7 @@ namespace config {
|
||||
|
||||
string_restricted_f(vars, "locale", config::sunshine.locale, {
|
||||
"bg"sv, // Bulgarian
|
||||
"cs"sv, // Czech
|
||||
"de"sv, // German
|
||||
"en"sv, // English
|
||||
"en_GB"sv, // English (UK)
|
||||
@@ -1257,6 +1261,7 @@ namespace config {
|
||||
"tr"sv, // Turkish
|
||||
"uk"sv, // Ukrainian
|
||||
"zh"sv, // Chinese
|
||||
"zh_TW"sv, // Chinese (Traditional)
|
||||
});
|
||||
|
||||
std::string log_level_string;
|
||||
|
||||
@@ -140,8 +140,8 @@ namespace config {
|
||||
workarounds_t wa;
|
||||
} dd;
|
||||
|
||||
int min_fps_factor; // Minimum fps target, determines minimum frame time
|
||||
int max_bitrate; // Maximum bitrate, sets ceiling in kbps for bitrate requested from client
|
||||
double minimum_fps_target; ///< Lowest framerate that will be used when streaming. Range 0-1000, 0 = half of client's requested framerate.
|
||||
};
|
||||
|
||||
struct audio_t {
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
#include "process.h"
|
||||
#include "utility.h"
|
||||
#include "uuid.h"
|
||||
#include "version.h"
|
||||
|
||||
using namespace std::literals;
|
||||
|
||||
@@ -81,7 +80,8 @@ namespace confighttp {
|
||||
void send_response(resp_https_t response, const nlohmann::json &output_tree) {
|
||||
SimpleWeb::CaseInsensitiveMultimap headers;
|
||||
headers.emplace("Content-Type", "application/json");
|
||||
|
||||
headers.emplace("X-Frame-Options", "DENY");
|
||||
headers.emplace("Content-Security-Policy", "frame-ancestors 'none';");
|
||||
response->write(output_tree.dump(), headers);
|
||||
}
|
||||
|
||||
@@ -103,7 +103,9 @@ namespace confighttp {
|
||||
|
||||
const SimpleWeb::CaseInsensitiveMultimap headers {
|
||||
{"Content-Type", "application/json"},
|
||||
{"WWW-Authenticate", R"(Basic realm="Sunshine Gamestream Host", charset="UTF-8")"}
|
||||
{"WWW-Authenticate", R"(Basic realm="Sunshine Gamestream Host", charset="UTF-8")"},
|
||||
{"X-Frame-Options", "DENY"},
|
||||
{"Content-Security-Policy", "frame-ancestors 'none';"}
|
||||
};
|
||||
|
||||
response->write(code, tree.dump(), headers);
|
||||
@@ -119,7 +121,9 @@ namespace confighttp {
|
||||
auto address = net::addr_to_normalized_string(request->remote_endpoint().address());
|
||||
BOOST_LOG(info) << "Web UI: ["sv << address << "] -- not authorized"sv;
|
||||
const SimpleWeb::CaseInsensitiveMultimap headers {
|
||||
{"Location", path}
|
||||
{"Location", path},
|
||||
{"X-Frame-Options", "DENY"},
|
||||
{"Content-Security-Policy", "frame-ancestors 'none';"}
|
||||
};
|
||||
response->write(SimpleWeb::StatusCode::redirection_temporary_redirect, headers);
|
||||
}
|
||||
@@ -189,6 +193,8 @@ namespace confighttp {
|
||||
|
||||
SimpleWeb::CaseInsensitiveMultimap headers;
|
||||
headers.emplace("Content-Type", "application/json");
|
||||
headers.emplace("X-Frame-Options", "DENY");
|
||||
headers.emplace("Content-Security-Policy", "frame-ancestors 'none';");
|
||||
|
||||
response->write(code, tree.dump(), headers);
|
||||
}
|
||||
@@ -209,10 +215,45 @@ namespace confighttp {
|
||||
|
||||
SimpleWeb::CaseInsensitiveMultimap headers;
|
||||
headers.emplace("Content-Type", "application/json");
|
||||
headers.emplace("X-Frame-Options", "DENY");
|
||||
headers.emplace("Content-Security-Policy", "frame-ancestors 'none';");
|
||||
|
||||
response->write(code, tree.dump(), headers);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Validate the request content type and send bad request when mismatch.
|
||||
* @param response The HTTP response object.
|
||||
* @param request The HTTP request object.
|
||||
* @param contentType The expected content type
|
||||
*/
|
||||
bool check_content_type(resp_https_t response, req_https_t request, const std::string_view &contentType) {
|
||||
auto requestContentType = request->header.find("content-type");
|
||||
if (requestContentType == request->header.end()) {
|
||||
bad_request(response, request, "Content type not provided");
|
||||
return false;
|
||||
}
|
||||
// Extract the media type part before any parameters (e.g., charset)
|
||||
std::string actualContentType = requestContentType->second;
|
||||
size_t semicolonPos = actualContentType.find(';');
|
||||
if (semicolonPos != std::string::npos) {
|
||||
actualContentType = actualContentType.substr(0, semicolonPos);
|
||||
}
|
||||
|
||||
// Trim whitespace and convert to lowercase for case-insensitive comparison
|
||||
boost::algorithm::trim(actualContentType);
|
||||
boost::algorithm::to_lower(actualContentType);
|
||||
|
||||
std::string expectedContentType(contentType);
|
||||
boost::algorithm::to_lower(expectedContentType);
|
||||
|
||||
if (actualContentType != expectedContentType) {
|
||||
bad_request(response, request, "Content type mismatch");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the index page.
|
||||
* @param response The HTTP response object.
|
||||
@@ -229,6 +270,8 @@ namespace confighttp {
|
||||
std::string content = file_handler::read_file(WEB_DIR "index.html");
|
||||
SimpleWeb::CaseInsensitiveMultimap headers;
|
||||
headers.emplace("Content-Type", "text/html; charset=utf-8");
|
||||
headers.emplace("X-Frame-Options", "DENY");
|
||||
headers.emplace("Content-Security-Policy", "frame-ancestors 'none';");
|
||||
response->write(content, headers);
|
||||
}
|
||||
|
||||
@@ -247,6 +290,8 @@ namespace confighttp {
|
||||
std::string content = file_handler::read_file(WEB_DIR "pin.html");
|
||||
SimpleWeb::CaseInsensitiveMultimap headers;
|
||||
headers.emplace("Content-Type", "text/html; charset=utf-8");
|
||||
headers.emplace("X-Frame-Options", "DENY");
|
||||
headers.emplace("Content-Security-Policy", "frame-ancestors 'none';");
|
||||
response->write(content, headers);
|
||||
}
|
||||
|
||||
@@ -265,6 +310,8 @@ namespace confighttp {
|
||||
std::string content = file_handler::read_file(WEB_DIR "apps.html");
|
||||
SimpleWeb::CaseInsensitiveMultimap headers;
|
||||
headers.emplace("Content-Type", "text/html; charset=utf-8");
|
||||
headers.emplace("X-Frame-Options", "DENY");
|
||||
headers.emplace("Content-Security-Policy", "frame-ancestors 'none';");
|
||||
headers.emplace("Access-Control-Allow-Origin", "https://images.igdb.com/");
|
||||
response->write(content, headers);
|
||||
}
|
||||
@@ -284,6 +331,8 @@ namespace confighttp {
|
||||
std::string content = file_handler::read_file(WEB_DIR "clients.html");
|
||||
SimpleWeb::CaseInsensitiveMultimap headers;
|
||||
headers.emplace("Content-Type", "text/html; charset=utf-8");
|
||||
headers.emplace("X-Frame-Options", "DENY");
|
||||
headers.emplace("Content-Security-Policy", "frame-ancestors 'none';");
|
||||
response->write(content, headers);
|
||||
}
|
||||
|
||||
@@ -302,6 +351,8 @@ namespace confighttp {
|
||||
std::string content = file_handler::read_file(WEB_DIR "config.html");
|
||||
SimpleWeb::CaseInsensitiveMultimap headers;
|
||||
headers.emplace("Content-Type", "text/html; charset=utf-8");
|
||||
headers.emplace("X-Frame-Options", "DENY");
|
||||
headers.emplace("Content-Security-Policy", "frame-ancestors 'none';");
|
||||
response->write(content, headers);
|
||||
}
|
||||
|
||||
@@ -320,6 +371,8 @@ namespace confighttp {
|
||||
std::string content = file_handler::read_file(WEB_DIR "password.html");
|
||||
SimpleWeb::CaseInsensitiveMultimap headers;
|
||||
headers.emplace("Content-Type", "text/html; charset=utf-8");
|
||||
headers.emplace("X-Frame-Options", "DENY");
|
||||
headers.emplace("Content-Security-Policy", "frame-ancestors 'none';");
|
||||
response->write(content, headers);
|
||||
}
|
||||
|
||||
@@ -337,6 +390,8 @@ namespace confighttp {
|
||||
std::string content = file_handler::read_file(WEB_DIR "welcome.html");
|
||||
SimpleWeb::CaseInsensitiveMultimap headers;
|
||||
headers.emplace("Content-Type", "text/html; charset=utf-8");
|
||||
headers.emplace("X-Frame-Options", "DENY");
|
||||
headers.emplace("Content-Security-Policy", "frame-ancestors 'none';");
|
||||
response->write(content, headers);
|
||||
}
|
||||
|
||||
@@ -355,6 +410,8 @@ namespace confighttp {
|
||||
std::string content = file_handler::read_file(WEB_DIR "troubleshooting.html");
|
||||
SimpleWeb::CaseInsensitiveMultimap headers;
|
||||
headers.emplace("Content-Type", "text/html; charset=utf-8");
|
||||
headers.emplace("X-Frame-Options", "DENY");
|
||||
headers.emplace("Content-Security-Policy", "frame-ancestors 'none';");
|
||||
response->write(content, headers);
|
||||
}
|
||||
|
||||
@@ -371,6 +428,8 @@ namespace confighttp {
|
||||
std::ifstream in(WEB_DIR "images/sunshine.ico", std::ios::binary);
|
||||
SimpleWeb::CaseInsensitiveMultimap headers;
|
||||
headers.emplace("Content-Type", "image/x-icon");
|
||||
headers.emplace("X-Frame-Options", "DENY");
|
||||
headers.emplace("Content-Security-Policy", "frame-ancestors 'none';");
|
||||
response->write(SimpleWeb::StatusCode::success_ok, in, headers);
|
||||
}
|
||||
|
||||
@@ -387,6 +446,8 @@ namespace confighttp {
|
||||
std::ifstream in(WEB_DIR "images/logo-sunshine-45.png", std::ios::binary);
|
||||
SimpleWeb::CaseInsensitiveMultimap headers;
|
||||
headers.emplace("Content-Type", "image/png");
|
||||
headers.emplace("X-Frame-Options", "DENY");
|
||||
headers.emplace("Content-Security-Policy", "frame-ancestors 'none';");
|
||||
response->write(SimpleWeb::StatusCode::success_ok, in, headers);
|
||||
}
|
||||
|
||||
@@ -438,6 +499,8 @@ namespace confighttp {
|
||||
// if it is, set the content type to the mime type
|
||||
SimpleWeb::CaseInsensitiveMultimap headers;
|
||||
headers.emplace("Content-Type", mimeType->second);
|
||||
headers.emplace("X-Frame-Options", "DENY");
|
||||
headers.emplace("Content-Security-Policy", "frame-ancestors 'none';");
|
||||
std::ifstream in(filePath.string(), std::ios::binary);
|
||||
response->write(SimpleWeb::StatusCode::success_ok, in, headers);
|
||||
}
|
||||
@@ -535,6 +598,9 @@ namespace confighttp {
|
||||
* @api_examples{/api/apps| POST| {"name":"Hello, World!","index":-1}}
|
||||
*/
|
||||
void saveApp(resp_https_t response, req_https_t request) {
|
||||
if (!check_content_type(response, request, "application/json")) {
|
||||
return;
|
||||
}
|
||||
if (!authenticate(response, request)) {
|
||||
return;
|
||||
}
|
||||
@@ -602,6 +668,9 @@ namespace confighttp {
|
||||
* @api_examples{/api/apps/close| POST| null}
|
||||
*/
|
||||
void closeApp(resp_https_t response, req_https_t request) {
|
||||
if (!check_content_type(response, request, "application/json")) {
|
||||
return;
|
||||
}
|
||||
if (!authenticate(response, request)) {
|
||||
return;
|
||||
}
|
||||
@@ -623,6 +692,8 @@ namespace confighttp {
|
||||
* @api_examples{/api/apps/9999| DELETE| null}
|
||||
*/
|
||||
void deleteApp(resp_https_t response, req_https_t request) {
|
||||
// Skip check_content_type() for this endpoint since the request body is not used.
|
||||
|
||||
if (!authenticate(response, request)) {
|
||||
return;
|
||||
}
|
||||
@@ -703,6 +774,9 @@ namespace confighttp {
|
||||
* @api_examples{/api/unpair| POST| {"uuid":"1234"}}
|
||||
*/
|
||||
void unpair(resp_https_t response, req_https_t request) {
|
||||
if (!check_content_type(response, request, "application/json")) {
|
||||
return;
|
||||
}
|
||||
if (!authenticate(response, request)) {
|
||||
return;
|
||||
}
|
||||
@@ -733,6 +807,9 @@ namespace confighttp {
|
||||
* @api_examples{/api/clients/unpair-all| POST| null}
|
||||
*/
|
||||
void unpairAll(resp_https_t response, req_https_t request) {
|
||||
if (!check_content_type(response, request, "application/json")) {
|
||||
return;
|
||||
}
|
||||
if (!authenticate(response, request)) {
|
||||
return;
|
||||
}
|
||||
@@ -764,7 +841,7 @@ namespace confighttp {
|
||||
nlohmann::json output_tree;
|
||||
output_tree["status"] = true;
|
||||
output_tree["platform"] = SUNSHINE_PLATFORM;
|
||||
output_tree["version"] = PROJECT_VER;
|
||||
output_tree["version"] = PROJECT_VERSION;
|
||||
|
||||
auto vars = config::parse_config(file_handler::read_file(config::sunshine.config_file.c_str()));
|
||||
|
||||
@@ -809,6 +886,9 @@ namespace confighttp {
|
||||
* @api_examples{/api/config| POST| {"key":"value"}}
|
||||
*/
|
||||
void saveConfig(resp_https_t response, req_https_t request) {
|
||||
if (!check_content_type(response, request, "application/json")) {
|
||||
return;
|
||||
}
|
||||
if (!authenticate(response, request)) {
|
||||
return;
|
||||
}
|
||||
@@ -855,6 +935,9 @@ namespace confighttp {
|
||||
* @api_examples{/api/covers/upload| POST| {"key":"igdb_1234","url":"https://images.igdb.com/igdb/image/upload/t_cover_big_2x/abc123.png"}}
|
||||
*/
|
||||
void uploadCover(resp_https_t response, req_https_t request) {
|
||||
if (!check_content_type(response, request, "application/json")) {
|
||||
return;
|
||||
}
|
||||
if (!authenticate(response, request)) {
|
||||
return;
|
||||
}
|
||||
@@ -917,6 +1000,8 @@ namespace confighttp {
|
||||
std::string content = file_handler::read_file(config::sunshine.log_file.c_str());
|
||||
SimpleWeb::CaseInsensitiveMultimap headers;
|
||||
headers.emplace("Content-Type", "text/plain");
|
||||
headers.emplace("X-Frame-Options", "DENY");
|
||||
headers.emplace("Content-Security-Policy", "frame-ancestors 'none';");
|
||||
response->write(SimpleWeb::StatusCode::success_ok, content, headers);
|
||||
}
|
||||
|
||||
@@ -938,6 +1023,9 @@ namespace confighttp {
|
||||
* @api_examples{/api/password| POST| {"currentUsername":"admin","currentPassword":"admin","newUsername":"admin","newPassword":"admin","confirmNewPassword":"admin"}}
|
||||
*/
|
||||
void savePassword(resp_https_t response, req_https_t request) {
|
||||
if (!check_content_type(response, request, "application/json")) {
|
||||
return;
|
||||
}
|
||||
if (!config::sunshine.username.empty() && !authenticate(response, request)) {
|
||||
return;
|
||||
}
|
||||
@@ -1008,6 +1096,9 @@ namespace confighttp {
|
||||
* @api_examples{/api/pin| POST| {"pin":"1234","name":"My PC"}}
|
||||
*/
|
||||
void savePin(resp_https_t response, req_https_t request) {
|
||||
if (!check_content_type(response, request, "application/json")) {
|
||||
return;
|
||||
}
|
||||
if (!authenticate(response, request)) {
|
||||
return;
|
||||
}
|
||||
@@ -1044,6 +1135,9 @@ namespace confighttp {
|
||||
* @api_examples{/api/reset-display-device-persistence| POST| null}
|
||||
*/
|
||||
void resetDisplayDevicePersistence(resp_https_t response, req_https_t request) {
|
||||
if (!check_content_type(response, request, "application/json")) {
|
||||
return;
|
||||
}
|
||||
if (!authenticate(response, request)) {
|
||||
return;
|
||||
}
|
||||
@@ -1063,6 +1157,9 @@ namespace confighttp {
|
||||
* @api_examples{/api/restart| POST| null}
|
||||
*/
|
||||
void restart(resp_https_t response, req_https_t request) {
|
||||
if (!check_content_type(response, request, "application/json")) {
|
||||
return;
|
||||
}
|
||||
if (!authenticate(response, request)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
#include "logging.h"
|
||||
#include "network.h"
|
||||
#include "platform/common.h"
|
||||
#include "version.h"
|
||||
|
||||
extern "C" {
|
||||
#ifdef _WIN32
|
||||
|
||||
@@ -15,11 +15,17 @@
|
||||
#include <boost/log/expressions.hpp>
|
||||
#include <boost/log/sinks.hpp>
|
||||
#include <boost/log/sources/severity_logger.hpp>
|
||||
#include <display_device/logging.h>
|
||||
|
||||
// local includes
|
||||
#include "logging.h"
|
||||
|
||||
// conditional includes
|
||||
#ifdef __ANDROID__
|
||||
#include <android/log.h>
|
||||
#else
|
||||
#include <display_device/logging.h>
|
||||
#endif
|
||||
|
||||
extern "C" {
|
||||
#include <libavutil/log.h>
|
||||
}
|
||||
@@ -97,6 +103,48 @@ namespace logging {
|
||||
os << "["sv << std::put_time(<, "%Y-%m-%d %H:%M:%S.") << boost::format("%03u") % ms.count() << "]: "sv
|
||||
<< log_type << view.attribute_values()[message].extract<std::string>();
|
||||
}
|
||||
#ifdef __ANDROID__
|
||||
namespace sinks = boost::log::sinks;
|
||||
namespace expr = boost::log::expressions;
|
||||
|
||||
void android_log(const std::string &message, int severity) {
|
||||
android_LogPriority android_priority;
|
||||
switch (severity) {
|
||||
case 0:
|
||||
android_priority = ANDROID_LOG_VERBOSE;
|
||||
break;
|
||||
case 1:
|
||||
android_priority = ANDROID_LOG_DEBUG;
|
||||
break;
|
||||
case 2:
|
||||
android_priority = ANDROID_LOG_INFO;
|
||||
break;
|
||||
case 3:
|
||||
android_priority = ANDROID_LOG_WARN;
|
||||
break;
|
||||
case 4:
|
||||
android_priority = ANDROID_LOG_ERROR;
|
||||
break;
|
||||
case 5:
|
||||
android_priority = ANDROID_LOG_FATAL;
|
||||
break;
|
||||
default:
|
||||
android_priority = ANDROID_LOG_UNKNOWN;
|
||||
break;
|
||||
}
|
||||
__android_log_print(android_priority, "Sunshine", "%s", message.c_str());
|
||||
}
|
||||
|
||||
// custom sink backend for android
|
||||
struct android_sink_backend: public sinks::basic_sink_backend<sinks::concurrent_feeding> {
|
||||
void consume(const bl::record_view &rec) {
|
||||
int log_sev = rec[severity].get();
|
||||
const std::string log_msg = rec[expr::smessage].get();
|
||||
// log to android
|
||||
android_log(log_msg, log_sev);
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
[[nodiscard]] std::unique_ptr<deinit_t> init(int min_log_level, const std::string &log_file) {
|
||||
if (sink) {
|
||||
@@ -104,8 +152,10 @@ namespace logging {
|
||||
deinit();
|
||||
}
|
||||
|
||||
#ifndef __ANDROID__
|
||||
setup_av_logging(min_log_level);
|
||||
setup_libdisplaydevice_logging(min_log_level);
|
||||
#endif
|
||||
|
||||
sink = boost::make_shared<text_sink>();
|
||||
|
||||
@@ -113,6 +163,7 @@ namespace logging {
|
||||
boost::shared_ptr<std::ostream> stream {&std::cout, boost::null_deleter()};
|
||||
sink->locked_backend()->add_stream(stream);
|
||||
#endif
|
||||
|
||||
sink->locked_backend()->add_stream(boost::make_shared<std::ofstream>(log_file));
|
||||
sink->set_filter(severity >= min_log_level);
|
||||
sink->set_formatter(&formatter);
|
||||
@@ -122,9 +173,15 @@ namespace logging {
|
||||
sink->locked_backend()->auto_flush(true);
|
||||
|
||||
bl::core::get()->add_sink(sink);
|
||||
|
||||
#ifdef __ANDROID__
|
||||
auto android_sink = boost::make_shared<sinks::synchronous_sink<android_sink_backend>>();
|
||||
bl::core::get()->add_sink(android_sink);
|
||||
#endif
|
||||
return std::make_unique<deinit_t>();
|
||||
}
|
||||
|
||||
#ifndef __ANDROID__
|
||||
void setup_av_logging(int min_log_level) {
|
||||
if (min_log_level >= 1) {
|
||||
av_log_set_level(AV_LOG_QUIET);
|
||||
@@ -182,6 +239,7 @@ namespace logging {
|
||||
}
|
||||
});
|
||||
}
|
||||
#endif
|
||||
|
||||
void log_flush() {
|
||||
if (sink) {
|
||||
|
||||
12
src/main.cpp
12
src/main.cpp
@@ -20,7 +20,6 @@
|
||||
#include "process.h"
|
||||
#include "system_tray.h"
|
||||
#include "upnp.h"
|
||||
#include "version.h"
|
||||
#include "video.h"
|
||||
|
||||
extern "C" {
|
||||
@@ -95,6 +94,10 @@ int main(int argc, char *argv[]) {
|
||||
task_pool_util::TaskPool::task_id_t force_shutdown = nullptr;
|
||||
|
||||
#ifdef _WIN32
|
||||
// Avoid searching the PATH in case a user has configured their system insecurely
|
||||
// by placing a user-writable directory in the system-wide PATH variable.
|
||||
SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_APPLICATION_DIR | LOAD_LIBRARY_SEARCH_SYSTEM32);
|
||||
|
||||
setlocale(LC_ALL, "C");
|
||||
#endif
|
||||
|
||||
@@ -119,7 +122,7 @@ int main(int argc, char *argv[]) {
|
||||
// logging can begin at this point
|
||||
// if anything is logged prior to this point, it will appear in stdout, but not in the log viewer in the UI
|
||||
// the version should be printed to the log before anything else
|
||||
BOOST_LOG(info) << PROJECT_NAME << " version: " << PROJECT_VER;
|
||||
BOOST_LOG(info) << PROJECT_NAME << " version: " << PROJECT_VERSION << " commit: " << PROJECT_VERSION_COMMIT;
|
||||
|
||||
// Log publisher metadata
|
||||
log_publisher_data();
|
||||
@@ -337,6 +340,7 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
std::thread httpThread {nvhttp::start};
|
||||
std::thread configThread {confighttp::start};
|
||||
std::thread rtspThread {rtsp_stream::start};
|
||||
|
||||
#ifdef _WIN32
|
||||
// If we're using the default port and GameStream is enabled, warn the user
|
||||
@@ -346,10 +350,12 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
#endif
|
||||
|
||||
rtsp_stream::rtpThread();
|
||||
// Wait for shutdown
|
||||
shutdown_event->view();
|
||||
|
||||
httpThread.join();
|
||||
configThread.join();
|
||||
rtspThread.join();
|
||||
|
||||
task_pool.stop();
|
||||
task_pool.join();
|
||||
|
||||
@@ -424,7 +424,7 @@ namespace platf {
|
||||
// UDP GSO on Linux currently only supports sending 64K or 64 segments at a time
|
||||
size_t seg_index = 0;
|
||||
const size_t seg_max = 65536 / 1500;
|
||||
struct iovec iovs[(send_info.headers ? std::min(seg_max, send_info.block_count) : 1) * max_iovs_per_msg] = {};
|
||||
struct iovec iovs[(send_info.headers ? std::min(seg_max, send_info.block_count) : 1) * max_iovs_per_msg];
|
||||
auto msg_size = send_info.header_size + send_info.payload_size;
|
||||
while (seg_index < send_info.block_count) {
|
||||
int iovlen = 0;
|
||||
@@ -507,10 +507,11 @@ namespace platf {
|
||||
|
||||
{
|
||||
// If GSO is not supported, use sendmmsg() instead.
|
||||
struct mmsghdr msgs[send_info.block_count] = {};
|
||||
struct iovec iovs[send_info.block_count * (send_info.headers ? 2 : 1)] = {};
|
||||
struct mmsghdr msgs[send_info.block_count];
|
||||
struct iovec iovs[send_info.block_count * (send_info.headers ? 2 : 1)];
|
||||
int iov_idx = 0;
|
||||
for (size_t i = 0; i < send_info.block_count; i++) {
|
||||
msgs[i].msg_len = 0;
|
||||
msgs[i].msg_hdr.msg_iov = &iovs[iov_idx];
|
||||
msgs[i].msg_hdr.msg_iovlen = send_info.headers ? 2 : 1;
|
||||
|
||||
@@ -528,6 +529,7 @@ namespace platf {
|
||||
msgs[i].msg_hdr.msg_namelen = msg.msg_namelen;
|
||||
msgs[i].msg_hdr.msg_control = cmbuf.buf;
|
||||
msgs[i].msg_hdr.msg_controllen = cmbuflen;
|
||||
msgs[i].msg_hdr.msg_flags = 0;
|
||||
}
|
||||
|
||||
// Call sendmmsg() until all messages are sent
|
||||
@@ -620,7 +622,7 @@ namespace platf {
|
||||
memcpy(CMSG_DATA(pktinfo_cm), &pktInfo, sizeof(pktInfo));
|
||||
}
|
||||
|
||||
struct iovec iovs[2] = {};
|
||||
struct iovec iovs[2];
|
||||
int iovlen = 0;
|
||||
if (send_info.header) {
|
||||
iovs[iovlen].iov_base = (void *) send_info.header;
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
+ (NSString *)getDisplayName:(CGDirectDisplayID)displayID {
|
||||
for (NSScreen *screen in [NSScreen screens]) {
|
||||
if (screen.deviceDescription[@"NSScreenNumber"] == [NSNumber numberWithUnsignedInt:displayID]) {
|
||||
if ([screen.deviceDescription[@"NSScreenNumber"] isEqualToNumber:[NSNumber numberWithUnsignedInt:displayID]]) {
|
||||
return screen.localizedName;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#define INITGUID
|
||||
|
||||
// platform includes
|
||||
#include <audioclient.h>
|
||||
#include <Audioclient.h>
|
||||
#include <avrt.h>
|
||||
#include <mmdeviceapi.h>
|
||||
#include <newdev.h>
|
||||
@@ -27,10 +27,8 @@ DEFINE_PROPERTYKEY(PKEY_Device_DeviceDesc, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x2
|
||||
DEFINE_PROPERTYKEY(PKEY_Device_FriendlyName, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 14); // DEVPROP_TYPE_STRING
|
||||
DEFINE_PROPERTYKEY(PKEY_DeviceInterface_FriendlyName, 0x026e516e, 0xb814, 0x414b, 0x83, 0xcd, 0x85, 0x6d, 0x6f, 0xef, 0x48, 0x22, 2);
|
||||
|
||||
#if defined(__x86_64) || defined(_M_AMD64)
|
||||
#if defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || defined(__amd64__) || defined(_M_AMD64)
|
||||
#define STEAM_DRIVER_SUBDIR L"x64"
|
||||
#elif defined(__i386) || defined(_M_IX86)
|
||||
#define STEAM_DRIVER_SUBDIR L"x86"
|
||||
#else
|
||||
#warning No known Steam audio driver for this architecture
|
||||
#endif
|
||||
@@ -174,19 +172,19 @@ namespace {
|
||||
std::to_string(waveformat.Format.nSamplesPerSec) + " ";
|
||||
|
||||
switch (waveformat.dwChannelMask) {
|
||||
case (waveformat_mask_stereo):
|
||||
case waveformat_mask_stereo:
|
||||
result += "2.0";
|
||||
break;
|
||||
|
||||
case (waveformat_mask_surround51_with_backspeakers):
|
||||
case waveformat_mask_surround51_with_backspeakers:
|
||||
result += "5.1";
|
||||
break;
|
||||
|
||||
case (waveformat_mask_surround51_with_sidespeakers):
|
||||
case waveformat_mask_surround51_with_sidespeakers:
|
||||
result += "5.1 (sidespeakers)";
|
||||
break;
|
||||
|
||||
case (waveformat_mask_surround71):
|
||||
case waveformat_mask_surround71:
|
||||
result += "7.1";
|
||||
break;
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <dxgi.h>
|
||||
#include <dxgi1_6.h>
|
||||
#include <Unknwn.h>
|
||||
#include <winrt/Windows.Graphics.Capture.h>
|
||||
#include <winrt/windows.graphics.capture.h>
|
||||
|
||||
// local includes
|
||||
#include "src/platform/common.h"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
// platform includes
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <DirectXMath.h>
|
||||
|
||||
extern "C" {
|
||||
#include <libavcodec/avcodec.h>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user