chore: update global workflows (#3813)
Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com>
This commit is contained in:
82
.github/workflows/CI.yml
vendored
82
.github/workflows/CI.yml
vendored
@@ -1,12 +1,19 @@
|
|||||||
---
|
---
|
||||||
name: CI
|
name: CI
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [master]
|
branches:
|
||||||
types: [opened, synchronize, reopened]
|
- master
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- synchronize
|
||||||
|
- reopened
|
||||||
push:
|
push:
|
||||||
branches: [master]
|
branches:
|
||||||
|
- master
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
@@ -17,7 +24,6 @@ jobs:
|
|||||||
github_env:
|
github_env:
|
||||||
name: GitHub Env Debug
|
name: GitHub Env Debug
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Dump github context
|
- name: Dump github context
|
||||||
run: echo "$GITHUB_CONTEXT"
|
run: echo "$GITHUB_CONTEXT"
|
||||||
@@ -46,12 +52,12 @@ jobs:
|
|||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
build_linux_flatpak:
|
build_linux_flatpak:
|
||||||
|
name: Linux Flatpak
|
||||||
env:
|
env:
|
||||||
APP_ID: dev.lizardbyte.app.Sunshine
|
APP_ID: dev.lizardbyte.app.Sunshine
|
||||||
NODE_VERSION: "20"
|
NODE_VERSION: "20"
|
||||||
PLATFORM_VERSION: "23.08"
|
PLATFORM_VERSION: "23.08"
|
||||||
name: Linux Flatpak
|
needs: setup_release
|
||||||
needs: [setup_release]
|
|
||||||
runs-on: ${{ matrix.runner }}
|
runs-on: ${{ matrix.runner }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false # false to test all, true to fail entire job if any fail
|
fail-fast: false # false to test all, true to fail entire job if any fail
|
||||||
@@ -61,7 +67,6 @@ jobs:
|
|||||||
runner: ubuntu-22.04
|
runner: ubuntu-22.04
|
||||||
- arch: aarch64
|
- arch: aarch64
|
||||||
runner: ubuntu-22.04-arm
|
runner: ubuntu-22.04-arm
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Maximize build space
|
- name: Maximize build space
|
||||||
uses: easimon/maximize-build-space@v10
|
uses: easimon/maximize-build-space@v10
|
||||||
@@ -85,12 +90,10 @@ jobs:
|
|||||||
node-version: ${{ env.NODE_VERSION }}
|
node-version: ${{ env.NODE_VERSION }}
|
||||||
|
|
||||||
- name: Install npm dependencies
|
- name: Install npm dependencies
|
||||||
run: |
|
run: npm install --package-lock-only
|
||||||
npm install --package-lock-only
|
|
||||||
|
|
||||||
- name: Debug package-lock.json
|
- name: Debug package-lock.json
|
||||||
run: |
|
run: cat package-lock.json
|
||||||
cat package-lock.json
|
|
||||||
|
|
||||||
- name: Setup python
|
- name: Setup python
|
||||||
id: python
|
id: python
|
||||||
@@ -121,12 +124,10 @@ jobs:
|
|||||||
|
|
||||||
- name: flatpak node generator
|
- name: flatpak node generator
|
||||||
# https://github.com/flatpak/flatpak-builder-tools/blob/master/node/README.md
|
# https://github.com/flatpak/flatpak-builder-tools/blob/master/node/README.md
|
||||||
run: |
|
run: flatpak-node-generator npm package-lock.json
|
||||||
flatpak-node-generator npm package-lock.json
|
|
||||||
|
|
||||||
- name: Debug generated-sources.json
|
- name: Debug generated-sources.json
|
||||||
run: |
|
run: cat generated-sources.json
|
||||||
cat generated-sources.json
|
|
||||||
|
|
||||||
- name: Cache Flatpak build
|
- name: Cache Flatpak build
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
@@ -171,8 +172,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Debug Manifest
|
- name: Debug Manifest
|
||||||
working-directory: build
|
working-directory: build
|
||||||
run: |
|
run: cat ${APP_ID}.yml
|
||||||
cat ${APP_ID}.yml
|
|
||||||
|
|
||||||
- name: Build Linux Flatpak
|
- name: Build Linux Flatpak
|
||||||
working-directory: build
|
working-directory: build
|
||||||
@@ -225,7 +225,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Package Flathub repo archive
|
- name: Package Flathub repo archive
|
||||||
# copy files required to generate the Flathub repo
|
# copy files required to generate the Flathub repo
|
||||||
if: ${{ matrix.arch == 'x86_64' }}
|
if: matrix.arch == 'x86_64'
|
||||||
run: |
|
run: |
|
||||||
mkdir -p flathub/modules
|
mkdir -p flathub/modules
|
||||||
cp ./build/generated-sources.json ./flathub/
|
cp ./build/generated-sources.json ./flathub/
|
||||||
@@ -245,9 +245,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: sunshine-linux-flatpak-${{ matrix.arch }}
|
name: sunshine-linux-flatpak-${{ matrix.arch }}
|
||||||
path: artifacts/
|
path: artifacts/
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
- name: Create/Update GitHub Release
|
- name: Create/Update GitHub Release
|
||||||
if: ${{ needs.setup_release.outputs.publish_release == 'true' }}
|
if: needs.setup_release.outputs.publish_release == 'true'
|
||||||
uses: LizardByte/create-release-action@v2025.102.13208
|
uses: LizardByte/create-release-action@v2025.102.13208
|
||||||
with:
|
with:
|
||||||
allowUpdates: true
|
allowUpdates: true
|
||||||
@@ -261,7 +262,7 @@ jobs:
|
|||||||
build_linux:
|
build_linux:
|
||||||
name: Linux ${{ matrix.type }}
|
name: Linux ${{ matrix.type }}
|
||||||
runs-on: ubuntu-${{ matrix.dist }}
|
runs-on: ubuntu-${{ matrix.dist }}
|
||||||
needs: [setup_release]
|
needs: setup_release
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false # false to test all, true to fail entire job if any fail
|
fail-fast: false # false to test all, true to fail entire job if any fail
|
||||||
matrix:
|
matrix:
|
||||||
@@ -269,7 +270,6 @@ jobs:
|
|||||||
- type: AppImage
|
- type: AppImage
|
||||||
EXTRA_ARGS: '--appimage-build'
|
EXTRA_ARGS: '--appimage-build'
|
||||||
dist: 22.04
|
dist: 22.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Maximize build space
|
- name: Maximize build space
|
||||||
uses: easimon/maximize-build-space@v10
|
uses: easimon/maximize-build-space@v10
|
||||||
@@ -344,14 +344,13 @@ jobs:
|
|||||||
--ubuntu-test-repo ${{ matrix.EXTRA_ARGS }}
|
--ubuntu-test-repo ${{ matrix.EXTRA_ARGS }}
|
||||||
|
|
||||||
- name: Set AppImage Version
|
- name: Set AppImage Version
|
||||||
if: |
|
if: matrix.type == 'AppImage'
|
||||||
matrix.type == 'AppImage'
|
|
||||||
run: |
|
run: |
|
||||||
version=${{ needs.setup_release.outputs.release_tag }}
|
version=${{ needs.setup_release.outputs.release_tag }}
|
||||||
echo "VERSION=${version}" >> $GITHUB_ENV
|
echo "VERSION=${version}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Package Linux - AppImage
|
- name: Package Linux - AppImage
|
||||||
if: ${{ matrix.type == 'AppImage' }}
|
if: matrix.type == 'AppImage'
|
||||||
working-directory: build
|
working-directory: build
|
||||||
run: |
|
run: |
|
||||||
# install sunshine to the DESTDIR
|
# install sunshine to the DESTDIR
|
||||||
@@ -396,7 +395,7 @@ jobs:
|
|||||||
rm -rf ./build/cuda
|
rm -rf ./build/cuda
|
||||||
|
|
||||||
- name: Verify AppImage
|
- name: Verify AppImage
|
||||||
if: ${{ matrix.type == 'AppImage' }}
|
if: matrix.type == 'AppImage'
|
||||||
run: |
|
run: |
|
||||||
wget https://github.com/TheAssassin/appimagelint/releases/download/continuous/appimagelint-x86_64.AppImage
|
wget https://github.com/TheAssassin/appimagelint/releases/download/continuous/appimagelint-x86_64.AppImage
|
||||||
chmod +x appimagelint-x86_64.AppImage
|
chmod +x appimagelint-x86_64.AppImage
|
||||||
@@ -408,6 +407,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: sunshine-linux-${{ matrix.type }}-${{ matrix.dist }}
|
name: sunshine-linux-${{ matrix.type }}-${{ matrix.dist }}
|
||||||
path: artifacts/
|
path: artifacts/
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
- name: Install test deps
|
- name: Install test deps
|
||||||
run: |
|
run: |
|
||||||
@@ -431,9 +431,9 @@ jobs:
|
|||||||
./test_sunshine --gtest_color=yes
|
./test_sunshine --gtest_color=yes
|
||||||
|
|
||||||
- name: Generate gcov report
|
- name: Generate gcov report
|
||||||
|
id: test_report
|
||||||
# any except canceled or skipped
|
# any except canceled or skipped
|
||||||
if: always() && (steps.test.outcome == 'success' || steps.test.outcome == 'failure')
|
if: always() && (steps.test.outcome == 'success' || steps.test.outcome == 'failure')
|
||||||
id: test_report
|
|
||||||
working-directory: build
|
working-directory: build
|
||||||
run: |
|
run: |
|
||||||
${{ steps.python.outputs.python-path }} -m pip install gcovr
|
${{ steps.python.outputs.python-path }} -m pip install gcovr
|
||||||
@@ -461,7 +461,7 @@ jobs:
|
|||||||
verbose: true
|
verbose: true
|
||||||
|
|
||||||
- name: Create/Update GitHub Release
|
- name: Create/Update GitHub Release
|
||||||
if: ${{ needs.setup_release.outputs.publish_release == 'true' }}
|
if: needs.setup_release.outputs.publish_release == 'true'
|
||||||
uses: LizardByte/create-release-action@v2025.102.13208
|
uses: LizardByte/create-release-action@v2025.102.13208
|
||||||
with:
|
with:
|
||||||
allowUpdates: true
|
allowUpdates: true
|
||||||
@@ -473,7 +473,8 @@ jobs:
|
|||||||
token: ${{ secrets.GH_BOT_TOKEN }}
|
token: ${{ secrets.GH_BOT_TOKEN }}
|
||||||
|
|
||||||
build_homebrew:
|
build_homebrew:
|
||||||
needs: [setup_release]
|
name: Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }})
|
||||||
|
needs: setup_release
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false # false to test all, true to fail entire job if any fail
|
fail-fast: false # false to test all, true to fail entire job if any fail
|
||||||
matrix:
|
matrix:
|
||||||
@@ -489,9 +490,7 @@ jobs:
|
|||||||
- os_version: "latest" # this job will only configure the formula for release, no validation
|
- os_version: "latest" # this job will only configure the formula for release, no validation
|
||||||
os_name: "ubuntu"
|
os_name: "ubuntu"
|
||||||
release: true
|
release: true
|
||||||
name: Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }})
|
|
||||||
runs-on: ${{ matrix.os_name }}-${{ matrix.os_version }}
|
runs-on: ${{ matrix.os_name }}-${{ matrix.os_version }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -579,16 +578,15 @@ jobs:
|
|||||||
cat ./homebrew/sunshine.rb
|
cat ./homebrew/sunshine.rb
|
||||||
|
|
||||||
- name: Upload Artifacts
|
- name: Upload Artifacts
|
||||||
if: ${{ matrix.release }}
|
if: matrix.release
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: sunshine-homebrew
|
name: sunshine-homebrew
|
||||||
path: homebrew/
|
path: homebrew/
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
- name: Setup Xvfb
|
- name: Setup Xvfb
|
||||||
if: |
|
if: matrix.release != true && runner.os == 'Linux'
|
||||||
matrix.release != true &&
|
|
||||||
runner.os == 'Linux'
|
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update -y
|
sudo apt-get update -y
|
||||||
sudo apt-get install -y \
|
sudo apt-get install -y \
|
||||||
@@ -601,8 +599,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Validate Homebrew Formula
|
- name: Validate Homebrew Formula
|
||||||
id: test
|
id: test
|
||||||
if: |
|
if: matrix.release != true
|
||||||
matrix.release != true
|
|
||||||
uses: LizardByte/homebrew-release-action@v2024.1115.14934
|
uses: LizardByte/homebrew-release-action@v2024.1115.14934
|
||||||
with:
|
with:
|
||||||
formula_file: ${{ github.workspace }}/homebrew/sunshine.rb
|
formula_file: ${{ github.workspace }}/homebrew/sunshine.rb
|
||||||
@@ -613,6 +610,7 @@ jobs:
|
|||||||
validate: true
|
validate: true
|
||||||
|
|
||||||
- name: Generate gcov report
|
- name: Generate gcov report
|
||||||
|
id: test_report
|
||||||
# any except canceled or skipped
|
# any except canceled or skipped
|
||||||
# TODO: fix coverage, no .gcno files are being created
|
# TODO: fix coverage, no .gcno files are being created
|
||||||
# TODO: .gcno files are supposed to be created next to .o files
|
# TODO: .gcno files are supposed to be created next to .o files
|
||||||
@@ -621,7 +619,6 @@ jobs:
|
|||||||
# always() &&
|
# always() &&
|
||||||
# matrix.release != true &&
|
# matrix.release != true &&
|
||||||
# (steps.test.outcome == 'success' || steps.test.outcome == 'failure')
|
# (steps.test.outcome == 'success' || steps.test.outcome == 'failure')
|
||||||
id: test_report
|
|
||||||
run: |
|
run: |
|
||||||
# if linux
|
# if linux
|
||||||
if [ "${{ runner.os }}" == "Linux" ]; then
|
if [ "${{ runner.os }}" == "Linux" ]; then
|
||||||
@@ -680,8 +677,7 @@ jobs:
|
|||||||
- name: Patch homebrew formula
|
- name: Patch homebrew formula
|
||||||
# create beta version of the formula
|
# create beta version of the formula
|
||||||
# don't run this on macOS, as the sed command fails
|
# don't run this on macOS, as the sed command fails
|
||||||
if: >-
|
if: matrix.release
|
||||||
matrix.release
|
|
||||||
run: |
|
run: |
|
||||||
# variables
|
# variables
|
||||||
formula_file="homebrew/sunshine-beta.rb"
|
formula_file="homebrew/sunshine-beta.rb"
|
||||||
@@ -713,9 +709,8 @@ jobs:
|
|||||||
|
|
||||||
build_win:
|
build_win:
|
||||||
name: Windows
|
name: Windows
|
||||||
|
needs: setup_release
|
||||||
runs-on: windows-2019
|
runs-on: windows-2019
|
||||||
needs: [setup_release]
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -931,9 +926,9 @@ jobs:
|
|||||||
./test_sunshine.exe --gtest_color=yes
|
./test_sunshine.exe --gtest_color=yes
|
||||||
|
|
||||||
- name: Generate gcov report
|
- name: Generate gcov report
|
||||||
|
id: test_report
|
||||||
# any except canceled or skipped
|
# any except canceled or skipped
|
||||||
if: always() && (steps.test.outcome == 'success' || steps.test.outcome == 'failure')
|
if: always() && (steps.test.outcome == 'success' || steps.test.outcome == 'failure')
|
||||||
id: test_report
|
|
||||||
shell: msys2 {0}
|
shell: msys2 {0}
|
||||||
working-directory: build
|
working-directory: build
|
||||||
run: |
|
run: |
|
||||||
@@ -979,9 +974,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: sunshine-windows
|
name: sunshine-windows
|
||||||
path: artifacts/
|
path: artifacts/
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
- name: Create/Update GitHub Release
|
- name: Create/Update GitHub Release
|
||||||
if: ${{ needs.setup_release.outputs.publish_release == 'true' }}
|
if: needs.setup_release.outputs.publish_release == 'true'
|
||||||
uses: LizardByte/create-release-action@v2025.102.13208
|
uses: LizardByte/create-release-action@v2025.102.13208
|
||||||
with:
|
with:
|
||||||
allowUpdates: true
|
allowUpdates: true
|
||||||
|
|||||||
2
.github/workflows/ci-copr.yml
vendored
2
.github/workflows/ci-copr.yml
vendored
@@ -1,5 +1,7 @@
|
|||||||
---
|
---
|
||||||
name: CI Copr
|
name: CI Copr
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|||||||
50
.github/workflows/ci-docker.yml
vendored
50
.github/workflows/ci-docker.yml
vendored
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
# This action is centrally managed in https://github.com/<organization>/.github/
|
# 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
|
# 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.
|
# the above-mentioned repo.
|
||||||
|
|
||||||
@@ -19,13 +19,20 @@
|
|||||||
# GitHub runner.
|
# GitHub runner.
|
||||||
|
|
||||||
name: CI Docker
|
name: CI Docker
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [master]
|
branches:
|
||||||
types: [opened, synchronize, reopened]
|
- master
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- synchronize
|
||||||
|
- reopened
|
||||||
push:
|
push:
|
||||||
branches: [master]
|
branches:
|
||||||
|
- master
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
@@ -97,10 +104,9 @@ jobs:
|
|||||||
solution: ${{ steps.find_dotnet.outputs.solution }}
|
solution: ${{ steps.find_dotnet.outputs.solution }}
|
||||||
|
|
||||||
setup_release:
|
setup_release:
|
||||||
if: ${{ needs.check_dockerfiles.outputs.dockerfiles }}
|
|
||||||
name: Setup Release
|
name: Setup Release
|
||||||
needs:
|
if: needs.check_dockerfiles.outputs.dockerfiles
|
||||||
- check_dockerfiles
|
needs: check_dockerfiles
|
||||||
outputs:
|
outputs:
|
||||||
publish_release: ${{ steps.setup_release.outputs.publish_release }}
|
publish_release: ${{ steps.setup_release.outputs.publish_release }}
|
||||||
release_body: ${{ steps.setup_release.outputs.release_body }}
|
release_body: ${{ steps.setup_release.outputs.release_body }}
|
||||||
@@ -121,17 +127,18 @@ jobs:
|
|||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
docker:
|
docker:
|
||||||
needs: [check_dockerfiles, setup_release]
|
name: Docker${{ matrix.tag }}
|
||||||
if: ${{ needs.check_dockerfiles.outputs.dockerfiles }}
|
if: needs.check_dockerfiles.outputs.dockerfiles
|
||||||
runs-on: ubuntu-22.04
|
needs:
|
||||||
|
- check_dockerfiles
|
||||||
|
- setup_release
|
||||||
permissions:
|
permissions:
|
||||||
packages: write
|
packages: write
|
||||||
contents: write
|
contents: write
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix: ${{ fromJson(needs.check_dockerfiles.outputs.matrix) }}
|
matrix: ${{ fromJson(needs.check_dockerfiles.outputs.matrix) }}
|
||||||
name: Docker${{ matrix.tag }}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Maximize build space
|
- name: Maximize build space
|
||||||
uses: easimon/maximize-build-space@v10
|
uses: easimon/maximize-build-space@v10
|
||||||
@@ -256,14 +263,14 @@ jobs:
|
|||||||
Docker-buildx${{ matrix.tag }}-
|
Docker-buildx${{ matrix.tag }}-
|
||||||
|
|
||||||
- name: Log in to Docker Hub
|
- name: Log in to Docker Hub
|
||||||
if: ${{ needs.setup_release.outputs.publish_release == 'true' }} # PRs do not have access to secrets
|
if: needs.setup_release.outputs.publish_release == 'true' # PRs do not have access to secrets
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
||||||
|
|
||||||
- name: Log in to the Container registry
|
- name: Log in to the Container registry
|
||||||
if: ${{ needs.setup_release.outputs.publish_release == 'true' }} # PRs do not have access to secrets
|
if: needs.setup_release.outputs.publish_release == 'true' # PRs do not have access to secrets
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
@@ -271,7 +278,7 @@ jobs:
|
|||||||
password: ${{ secrets.GH_BOT_TOKEN }}
|
password: ${{ secrets.GH_BOT_TOKEN }}
|
||||||
|
|
||||||
- name: Build artifacts
|
- name: Build artifacts
|
||||||
if: ${{ steps.prepare.outputs.artifacts == 'true' }}
|
if: steps.prepare.outputs.artifacts == 'true'
|
||||||
id: build_artifacts
|
id: build_artifacts
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
@@ -314,7 +321,7 @@ jobs:
|
|||||||
no-cache-filters: ${{ steps.prepare.outputs.no_cache_filters }}
|
no-cache-filters: ${{ steps.prepare.outputs.no_cache_filters }}
|
||||||
|
|
||||||
- name: Arrange Artifacts
|
- name: Arrange Artifacts
|
||||||
if: ${{ steps.prepare.outputs.artifacts == 'true' }}
|
if: steps.prepare.outputs.artifacts == 'true'
|
||||||
working-directory: artifacts
|
working-directory: artifacts
|
||||||
run: |
|
run: |
|
||||||
# debug directory
|
# debug directory
|
||||||
@@ -336,14 +343,17 @@ jobs:
|
|||||||
rm -f ./provenance.json
|
rm -f ./provenance.json
|
||||||
|
|
||||||
- name: Upload Artifacts
|
- name: Upload Artifacts
|
||||||
if: ${{ steps.prepare.outputs.artifacts == 'true' }}
|
if: steps.prepare.outputs.artifacts == 'true'
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: Docker${{ matrix.tag }}
|
name: Docker${{ matrix.tag }}
|
||||||
path: artifacts/
|
path: artifacts/
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
- name: Create/Update GitHub Release
|
- name: Create/Update GitHub Release
|
||||||
if: ${{ needs.setup_release.outputs.publish_release == 'true' && steps.prepare.outputs.artifacts == 'true' }}
|
if: >
|
||||||
|
needs.setup_release.outputs.publish_release == 'true' &&
|
||||||
|
steps.prepare.outputs.artifacts == 'true'
|
||||||
uses: LizardByte/create-release-action@v2025.102.13208
|
uses: LizardByte/create-release-action@v2025.102.13208
|
||||||
with:
|
with:
|
||||||
allowUpdates: true
|
allowUpdates: true
|
||||||
@@ -356,7 +366,9 @@ jobs:
|
|||||||
token: ${{ secrets.GH_BOT_TOKEN }}
|
token: ${{ secrets.GH_BOT_TOKEN }}
|
||||||
|
|
||||||
- name: Update Docker Hub Description
|
- name: Update Docker Hub Description
|
||||||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
if: >
|
||||||
|
github.event_name == 'push' &&
|
||||||
|
github.ref == 'refs/heads/master'
|
||||||
uses: peter-evans/dockerhub-description@v4
|
uses: peter-evans/dockerhub-description@v4
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||||
|
|||||||
63
.github/workflows/codeql.yml
vendored
63
.github/workflows/codeql.yml
vendored
@@ -1,17 +1,21 @@
|
|||||||
---
|
---
|
||||||
# This action is centrally managed in https://github.com/<organization>/.github/
|
# 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
|
# 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.
|
# the above-mentioned repo.
|
||||||
|
|
||||||
# This workflow will analyze all supported languages in the repository using CodeQL Analysis.
|
# This workflow will analyze all supported languages in the repository using CodeQL Analysis.
|
||||||
|
|
||||||
name: "CodeQL"
|
name: "CodeQL"
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: ["master"]
|
branches:
|
||||||
|
- master
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: ["master"]
|
branches:
|
||||||
|
- master
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '00 12 * * 0' # every Sunday at 12:00 UTC
|
- cron: '00 12 * * 0' # every Sunday at 12:00 UTC
|
||||||
|
|
||||||
@@ -22,14 +26,17 @@ concurrency:
|
|||||||
jobs:
|
jobs:
|
||||||
languages:
|
languages:
|
||||||
name: Get language matrix
|
name: Get language matrix
|
||||||
runs-on: ubuntu-latest
|
|
||||||
outputs:
|
outputs:
|
||||||
matrix: ${{ steps.lang.outputs.result }}
|
matrix: ${{ steps.lang.outputs.result }}
|
||||||
continue: ${{ steps.continue.outputs.result }}
|
continue: ${{ steps.continue.outputs.result }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Get repo languages
|
- name: Get repo languages
|
||||||
uses: actions/github-script@v7
|
|
||||||
id: lang
|
id: lang
|
||||||
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
// CodeQL supports ['cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift']
|
// CodeQL supports ['cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift']
|
||||||
@@ -54,6 +61,22 @@ jobs:
|
|||||||
// Track languages we've already added to avoid duplicates
|
// Track languages we've already added to avoid duplicates
|
||||||
const addedLanguages = new Set()
|
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)) {
|
for (let [key, value] of Object.entries(response.data)) {
|
||||||
// remap language
|
// remap language
|
||||||
if (remap_languages[key.toLowerCase()]) {
|
if (remap_languages[key.toLowerCase()]) {
|
||||||
@@ -78,11 +101,18 @@ jobs:
|
|||||||
// set name for matrix
|
// set name for matrix
|
||||||
let name = osList.length === 1 ? normalizedKey : `${normalizedKey}, ${os}`
|
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
|
// add to matrix
|
||||||
matrix['include'].push({
|
matrix['include'].push({
|
||||||
|
"category": category,
|
||||||
"language": normalizedKey,
|
"language": normalizedKey,
|
||||||
"os": os,
|
"name": name,
|
||||||
"name": name
|
"os": os
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -94,8 +124,8 @@ jobs:
|
|||||||
return matrix
|
return matrix
|
||||||
|
|
||||||
- name: Continue
|
- name: Continue
|
||||||
uses: actions/github-script@v7
|
|
||||||
id: continue
|
id: continue
|
||||||
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
// if matrix['include'] is an empty list return false, otherwise true
|
// if matrix['include'] is an empty list return false, otherwise true
|
||||||
@@ -109,24 +139,22 @@ jobs:
|
|||||||
|
|
||||||
analyze:
|
analyze:
|
||||||
name: Analyze (${{ matrix.name }})
|
name: Analyze (${{ matrix.name }})
|
||||||
if: ${{ needs.languages.outputs.continue == 'true' }}
|
if: needs.languages.outputs.continue == 'true'
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
shell: ${{ matrix.os == 'windows-latest' && 'msys2 {0}' || 'bash' }}
|
shell: ${{ matrix.os == 'windows-latest' && 'msys2 {0}' || 'bash' }}
|
||||||
env:
|
env:
|
||||||
GITHUB_CODEQL_BUILD: true
|
GITHUB_CODEQL_BUILD: true
|
||||||
needs: [languages]
|
needs: languages
|
||||||
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
|
|
||||||
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
|
|
||||||
permissions:
|
permissions:
|
||||||
actions: read
|
actions: read
|
||||||
contents: read
|
contents: read
|
||||||
security-events: write
|
security-events: write
|
||||||
|
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix: ${{ fromJson(needs.languages.outputs.matrix) }}
|
matrix: ${{ fromJson(needs.languages.outputs.matrix) }}
|
||||||
|
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
|
||||||
steps:
|
steps:
|
||||||
- name: Maximize build space
|
- name: Maximize build space
|
||||||
if: >-
|
if: >-
|
||||||
@@ -174,8 +202,7 @@ jobs:
|
|||||||
- third-party
|
- third-party
|
||||||
|
|
||||||
# Pre autobuild
|
# Pre autobuild
|
||||||
# create a file named .codeql-prebuild-${{ matrix.language }}.sh in the root of your repository
|
# create a file named .codeql-prebuild-${{ matrix.language }}-${{ runner.os }}.sh in the root of your repository
|
||||||
# create a file named .codeql-build-${{ matrix.language }}.sh in the root of your repository
|
|
||||||
- name: Prebuild
|
- name: Prebuild
|
||||||
id: prebuild
|
id: prebuild
|
||||||
run: |
|
run: |
|
||||||
@@ -194,7 +221,7 @@ jobs:
|
|||||||
- name: Perform CodeQL Analysis
|
- name: Perform CodeQL Analysis
|
||||||
uses: github/codeql-action/analyze@v3
|
uses: github/codeql-action/analyze@v3
|
||||||
with:
|
with:
|
||||||
category: "/language:${{matrix.language}}"
|
category: "${{ matrix.category }}"
|
||||||
output: sarif-results
|
output: sarif-results
|
||||||
upload: failure-only
|
upload: failure-only
|
||||||
|
|
||||||
@@ -211,6 +238,7 @@ jobs:
|
|||||||
- name: Upload SARIF
|
- name: Upload SARIF
|
||||||
uses: github/codeql-action/upload-sarif@v3
|
uses: github/codeql-action/upload-sarif@v3
|
||||||
with:
|
with:
|
||||||
|
category: "${{ matrix.category }}"
|
||||||
sarif_file: sarif-results/${{ matrix.language }}.sarif
|
sarif_file: sarif-results/${{ matrix.language }}.sarif
|
||||||
|
|
||||||
- name: Upload loc as a Build Artifact
|
- name: Upload loc as a Build Artifact
|
||||||
@@ -218,4 +246,5 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: sarif-results-${{ matrix.language }}-${{ runner.os }}
|
name: sarif-results-${{ matrix.language }}-${{ runner.os }}
|
||||||
path: sarif-results
|
path: sarif-results
|
||||||
|
if-no-files-found: error
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|||||||
18
.github/workflows/common-lint.yml
vendored
18
.github/workflows/common-lint.yml
vendored
@@ -1,16 +1,22 @@
|
|||||||
---
|
---
|
||||||
# This action is centrally managed in https://github.com/<organization>/.github/
|
# 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
|
# 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.
|
# the above-mentioned repo.
|
||||||
|
|
||||||
# Common linting.
|
# Common linting.
|
||||||
|
|
||||||
name: common lint
|
name: common lint
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [master]
|
branches:
|
||||||
types: [opened, synchronize, reopened]
|
- master
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- synchronize
|
||||||
|
- reopened
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: "${{ github.workflow }}-${{ github.ref }}"
|
group: "${{ github.workflow }}-${{ github.ref }}"
|
||||||
@@ -77,9 +83,10 @@ jobs:
|
|||||||
|
|
||||||
- name: C++ - Clang format lint
|
- name: C++ - Clang format lint
|
||||||
if: always() && steps.cpp_files.outputs.found_files
|
if: always() && steps.cpp_files.outputs.found_files
|
||||||
uses: DoozyX/clang-format-lint-action@v0.18
|
uses: DoozyX/clang-format-lint-action@v0.20
|
||||||
with:
|
with:
|
||||||
source: ${{ steps.cpp_files.outputs.found_files }}
|
source: ${{ steps.cpp_files.outputs.found_files }}
|
||||||
|
clangFormatVersion: '20'
|
||||||
extensions: 'c,cpp,h,hpp,m,mm'
|
extensions: 'c,cpp,h,hpp,m,mm'
|
||||||
style: file
|
style: file
|
||||||
inplace: false
|
inplace: false
|
||||||
@@ -263,5 +270,4 @@ jobs:
|
|||||||
|
|
||||||
- name: YAML - log
|
- name: YAML - log
|
||||||
if: always() && steps.yamllint.outcome == 'failure'
|
if: always() && steps.yamllint.outcome == 'failure'
|
||||||
run: |
|
run: cat "${{ steps.yamllint.outputs.logfile }}" >> $GITHUB_STEP_SUMMARY
|
||||||
cat "${{ steps.yamllint.outputs.logfile }}" >> $GITHUB_STEP_SUMMARY
|
|
||||||
|
|||||||
11
.github/workflows/issues.yml
vendored
11
.github/workflows/issues.yml
vendored
@@ -1,17 +1,22 @@
|
|||||||
---
|
---
|
||||||
# This action is centrally managed in https://github.com/<organization>/.github/
|
# 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
|
# 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.
|
# the above-mentioned repo.
|
||||||
|
|
||||||
# Label and un-label actions using `../label-actions.yml`.
|
# Label and un-label actions using `../label-actions.yml`.
|
||||||
|
|
||||||
name: Issues
|
name: Issues
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
on:
|
on:
|
||||||
issues:
|
issues:
|
||||||
types: [labeled, unlabeled]
|
types:
|
||||||
|
- labeled
|
||||||
|
- unlabeled
|
||||||
discussion:
|
discussion:
|
||||||
types: [labeled, unlabeled]
|
types:
|
||||||
|
- labeled
|
||||||
|
- unlabeled
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
label:
|
label:
|
||||||
|
|||||||
13
.github/workflows/localize.yml
vendored
13
.github/workflows/localize.yml
vendored
@@ -1,10 +1,13 @@
|
|||||||
---
|
---
|
||||||
name: localize
|
name: localize
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [master]
|
branches:
|
||||||
paths: # prevents workflow from running unless these files change
|
- master
|
||||||
|
paths:
|
||||||
- '.github/workflows/localize.yml'
|
- '.github/workflows/localize.yml'
|
||||||
- 'src/**'
|
- 'src/**'
|
||||||
- 'locale/sunshine.po'
|
- 'locale/sunshine.po'
|
||||||
@@ -54,7 +57,7 @@ jobs:
|
|||||||
python ./scripts/_locale.py --extract
|
python ./scripts/_locale.py --extract
|
||||||
|
|
||||||
- name: git diff
|
- name: git diff
|
||||||
if: ${{ env.new_file == 'false' }}
|
if: env.new_file == 'false'
|
||||||
run: |
|
run: |
|
||||||
# disable the pager
|
# disable the pager
|
||||||
git config --global pager.diff false
|
git config --global pager.diff false
|
||||||
@@ -68,7 +71,9 @@ jobs:
|
|||||||
|
|
||||||
- name: git reset
|
- name: git reset
|
||||||
# only run if a single line changed (date/time) and file already existed
|
# only run if a single line changed (date/time) and file already existed
|
||||||
if: ${{ env.git_diff == '1 1 locale/sunshine.po' && env.new_file == 'false' }}
|
if: >-
|
||||||
|
env.git_diff == '1 1 locale/sunshine.po' &&
|
||||||
|
env.new_file == 'false'
|
||||||
run: |
|
run: |
|
||||||
git reset --hard
|
git reset --hard
|
||||||
|
|
||||||
|
|||||||
19
.github/workflows/release-notifier-moonlight.yml
vendored
19
.github/workflows/release-notifier-moonlight.yml
vendored
@@ -1,5 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: Release Notifications (Moonlight)
|
name: Release Notifications (Moonlight)
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
@@ -8,13 +9,23 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
discord:
|
discord:
|
||||||
if: >-
|
if: github.repository_owner == 'LizardByte'
|
||||||
startsWith(github.repository, 'LizardByte/') &&
|
|
||||||
!github.event.release.prerelease &&
|
|
||||||
!github.event.release.draft
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- name: Check if latest GitHub release
|
||||||
|
id: check-release
|
||||||
|
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: discord
|
- name: discord
|
||||||
|
if: steps.check-release.outputs.isLatestRelease == 'true'
|
||||||
uses: sarisia/actions-status-discord@v1
|
uses: sarisia/actions-status-discord@v1
|
||||||
with:
|
with:
|
||||||
avatar_url: ${{ vars.ORG_LOGO_URL }}256
|
avatar_url: ${{ vars.ORG_LOGO_URL }}256
|
||||||
|
|||||||
15
.github/workflows/release-notifier.yml
vendored
15
.github/workflows/release-notifier.yml
vendored
@@ -1,11 +1,13 @@
|
|||||||
---
|
---
|
||||||
# This action is centrally managed in https://github.com/<organization>/.github/
|
# 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
|
# 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.
|
# the above-mentioned repo.
|
||||||
|
|
||||||
# Create a blog post for a new release and open a PR to the blog repo
|
# Create a blog post for a new release and open a PR to the blog repo
|
||||||
|
|
||||||
name: Release Notifications
|
name: Release Notifications
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
@@ -14,8 +16,8 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update-blog:
|
update-blog:
|
||||||
if: >-
|
name: Update blog
|
||||||
github.repository_owner == 'LizardByte'
|
if: github.repository_owner == 'LizardByte'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Check topics
|
- name: Check topics
|
||||||
@@ -41,8 +43,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Check if latest GitHub release
|
- name: Check if latest GitHub release
|
||||||
id: check-release
|
id: check-release
|
||||||
if: >-
|
if: steps.check-label.outputs.hasTopic == 'true'
|
||||||
steps.check-label.outputs.hasTopic == 'true'
|
|
||||||
uses: actions/github-script@v7
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
@@ -128,9 +129,7 @@ jobs:
|
|||||||
steps.check-label.outputs.hasTopic == 'true' &&
|
steps.check-label.outputs.hasTopic == 'true' &&
|
||||||
steps.check-release.outputs.isLatestRelease == 'true'
|
steps.check-release.outputs.isLatestRelease == 'true'
|
||||||
run: |
|
run: |
|
||||||
gh \
|
gh pr merge \
|
||||||
pr \
|
|
||||||
merge \
|
|
||||||
--auto \
|
--auto \
|
||||||
--delete-branch \
|
--delete-branch \
|
||||||
--repo "LizardByte/LizardByte.github.io" \
|
--repo "LizardByte/LizardByte.github.io" \
|
||||||
|
|||||||
10
.github/workflows/update-changelog.yml
vendored
10
.github/workflows/update-changelog.yml
vendored
@@ -1,15 +1,20 @@
|
|||||||
---
|
---
|
||||||
# This action is centrally managed in https://github.com/<organization>/.github/
|
# 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
|
# 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.
|
# the above-mentioned repo.
|
||||||
|
|
||||||
# Update changelog on release events.
|
# Update changelog on release events.
|
||||||
|
|
||||||
name: Update changelog
|
name: Update changelog
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
types: [created, edited, deleted]
|
types:
|
||||||
|
- created
|
||||||
|
- edited
|
||||||
|
- deleted
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
@@ -18,6 +23,7 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update-changelog:
|
update-changelog:
|
||||||
|
name: Update Changelog
|
||||||
if: >-
|
if: >-
|
||||||
github.event_name == 'workflow_dispatch' ||
|
github.event_name == 'workflow_dispatch' ||
|
||||||
(!github.event.release.prerelease && !github.event.release.draft)
|
(!github.event.release.prerelease && !github.event.release.draft)
|
||||||
|
|||||||
13
.github/workflows/update-docs.yml
vendored
13
.github/workflows/update-docs.yml
vendored
@@ -1,19 +1,23 @@
|
|||||||
---
|
---
|
||||||
# This action is centrally managed in https://github.com/<organization>/.github/
|
# 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
|
# 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.
|
# the above-mentioned repo.
|
||||||
|
|
||||||
# Use the `rtd` repository label to identify repositories that should trigger have this workflow.
|
# 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
|
# If the project slug is not the repository name, add a repository variable named `READTHEDOCS_SLUG` with the value of
|
||||||
# the ReadTheDocs project slug.
|
# the ReadTheDocs project slug.
|
||||||
|
|
||||||
# Update readthedocs on release events.
|
# Update readthedocs on release events.
|
||||||
|
|
||||||
name: Update docs
|
name: Update docs
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
types: [created, edited, deleted]
|
types:
|
||||||
|
- created
|
||||||
|
- edited
|
||||||
|
- deleted
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: "${{ github.workflow }}-${{ github.event.release.tag_name }}"
|
group: "${{ github.workflow }}-${{ github.event.release.tag_name }}"
|
||||||
@@ -73,8 +77,7 @@ jobs:
|
|||||||
- name: Update RTD project
|
- name: Update RTD project
|
||||||
# changing the default branch in readthedocs makes "latest" point to that branch/tag
|
# changing the default branch in readthedocs makes "latest" point to that branch/tag
|
||||||
# we can also update other properties like description, etc.
|
# we can also update other properties like description, etc.
|
||||||
if: >-
|
if: steps.check.outputs.isLatestRelease == 'true'
|
||||||
steps.check.outputs.isLatestRelease == 'true'
|
|
||||||
run: |
|
run: |
|
||||||
json_body=$(jq -n \
|
json_body=$(jq -n \
|
||||||
--arg default_branch "${TAG}" \
|
--arg default_branch "${TAG}" \
|
||||||
|
|||||||
22
.github/workflows/update-flathub-repo.yml
vendored
22
.github/workflows/update-flathub-repo.yml
vendored
@@ -1,11 +1,15 @@
|
|||||||
---
|
---
|
||||||
# This action is a candidate to centrally manage in https://github.com/<organization>/.github/
|
# This workflow is centrally managed in https://github.com/<organization>/.github/
|
||||||
# If more Flathub applications are developed, consider moving this action to the organization's .github repository,
|
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||||
# using the `flathub-pkg` repository label to identify repositories that should trigger this workflow.
|
# 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.
|
# Update Flathub on release events.
|
||||||
|
|
||||||
name: Update flathub repo
|
name: Update flathub repo
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
@@ -20,14 +24,13 @@ jobs:
|
|||||||
update-flathub-repo:
|
update-flathub-repo:
|
||||||
env:
|
env:
|
||||||
FLATHUB_PKG: dev.lizardbyte.app.${{ github.event.repository.name }}
|
FLATHUB_PKG: dev.lizardbyte.app.${{ github.event.repository.name }}
|
||||||
if: >-
|
if: github.repository_owner == 'LizardByte'
|
||||||
github.repository_owner == 'LizardByte'
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Check if flathub repo
|
- name: Check if flathub repo
|
||||||
|
id: check-label
|
||||||
env:
|
env:
|
||||||
TOPIC: flathub-pkg
|
TOPIC: flathub-pkg
|
||||||
id: check-label
|
|
||||||
uses: actions/github-script@v7
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
@@ -47,8 +50,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Check if latest GitHub release
|
- name: Check if latest GitHub release
|
||||||
id: check-release
|
id: check-release
|
||||||
if: >-
|
if: steps.check-label.outputs.hasTopic == 'true'
|
||||||
steps.check-label.outputs.hasTopic == 'true'
|
|
||||||
uses: actions/github-script@v7
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
@@ -196,9 +198,7 @@ jobs:
|
|||||||
steps.check-release.outputs.isLatestRelease == 'true' &&
|
steps.check-release.outputs.isLatestRelease == 'true' &&
|
||||||
fromJson(steps.download.outputs.downloaded_files)[0]
|
fromJson(steps.download.outputs.downloaded_files)[0]
|
||||||
run: |
|
run: |
|
||||||
gh \
|
gh pr merge \
|
||||||
pr \
|
|
||||||
merge \
|
|
||||||
--auto \
|
--auto \
|
||||||
--delete-branch \
|
--delete-branch \
|
||||||
--repo "flathub/${{ env.FLATHUB_PKG }}" \
|
--repo "flathub/${{ env.FLATHUB_PKG }}" \
|
||||||
|
|||||||
21
.github/workflows/update-homebrew-release.yml
vendored
21
.github/workflows/update-homebrew-release.yml
vendored
@@ -1,15 +1,20 @@
|
|||||||
---
|
---
|
||||||
# This action is a candidate to centrally manage in https://github.com/<organization>/.github/
|
# This workflow is centrally managed in https://github.com/<organization>/.github/
|
||||||
# If more Homebrew applications are developed, consider moving this action to the organization's .github repository,
|
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||||
# using the `homebrew-pkg` repository label to identify repositories that should trigger this workflow.
|
# 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.
|
# Update Homebrew on release events.
|
||||||
|
|
||||||
name: Update Homebrew release
|
name: Update Homebrew release
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
types: [released]
|
types:
|
||||||
|
- released
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: "${{ github.workflow }}-${{ github.event.release.tag_name }}"
|
group: "${{ github.workflow }}-${{ github.event.release.tag_name }}"
|
||||||
@@ -17,14 +22,13 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update-homebrew-release:
|
update-homebrew-release:
|
||||||
if: >-
|
if: github.repository_owner == 'LizardByte'
|
||||||
github.repository_owner == 'LizardByte'
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Check if Homebrew repo
|
- name: Check if Homebrew repo
|
||||||
|
id: check-label
|
||||||
env:
|
env:
|
||||||
TOPIC: homebrew-pkg
|
TOPIC: homebrew-pkg
|
||||||
id: check-label
|
|
||||||
uses: actions/github-script@v7
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
@@ -44,8 +48,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Download release asset
|
- name: Download release asset
|
||||||
id: download
|
id: download
|
||||||
if: >-
|
if: steps.check-label.outputs.hasTopic == 'true'
|
||||||
steps.check-label.outputs.hasTopic == 'true'
|
|
||||||
uses: robinraju/release-downloader@v1.12
|
uses: robinraju/release-downloader@v1.12
|
||||||
with:
|
with:
|
||||||
repository: "${{ github.repository }}"
|
repository: "${{ github.repository }}"
|
||||||
|
|||||||
22
.github/workflows/update-pacman-repo.yml
vendored
22
.github/workflows/update-pacman-repo.yml
vendored
@@ -1,15 +1,20 @@
|
|||||||
---
|
---
|
||||||
# This action is a candidate to centrally manage in https://github.com/<organization>/.github/
|
# This workflow is centrally managed in https://github.com/<organization>/.github/
|
||||||
# If more pacman packages are developed, consider moving this action to the organization's .github repository,
|
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||||
# using the `pacman-pkg` repository label to identify repositories that should trigger have this workflow.
|
# 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.
|
# Update pacman repo on release events.
|
||||||
|
|
||||||
name: Update pacman repo
|
name: Update pacman repo
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
types: [released]
|
types:
|
||||||
|
- released
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: "${{ github.workflow }}-${{ github.event.release.tag_name }}"
|
group: "${{ github.workflow }}-${{ github.event.release.tag_name }}"
|
||||||
@@ -17,14 +22,13 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update-homebrew-release:
|
update-homebrew-release:
|
||||||
if: >-
|
if: github.repository_owner == 'LizardByte'
|
||||||
github.repository_owner == 'LizardByte'
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Check if pacman repo
|
- name: Check if pacman repo
|
||||||
|
id: check-label
|
||||||
env:
|
env:
|
||||||
TOPIC: pacman-pkg
|
TOPIC: pacman-pkg
|
||||||
id: check-label
|
|
||||||
uses: actions/github-script@v7
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
@@ -123,9 +127,7 @@ jobs:
|
|||||||
steps.check-release.outputs.isLatestRelease == 'true' &&
|
steps.check-release.outputs.isLatestRelease == 'true' &&
|
||||||
fromJson(steps.download.outputs.downloaded_files)[0]
|
fromJson(steps.download.outputs.downloaded_files)[0]
|
||||||
run: |
|
run: |
|
||||||
gh \
|
gh pr merge \
|
||||||
pr \
|
|
||||||
merge \
|
|
||||||
--auto \
|
--auto \
|
||||||
--delete-branch \
|
--delete-branch \
|
||||||
--squash \
|
--squash \
|
||||||
|
|||||||
10
.github/workflows/update-pages.yml
vendored
10
.github/workflows/update-pages.yml
vendored
@@ -1,5 +1,7 @@
|
|||||||
---
|
---
|
||||||
name: Build GH-Pages
|
name: Build GH-Pages
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
@@ -37,11 +39,11 @@ jobs:
|
|||||||
call-jekyll-build:
|
call-jekyll-build:
|
||||||
needs: prep
|
needs: prep
|
||||||
uses: LizardByte/LizardByte.github.io/.github/workflows/jekyll-build.yml@master
|
uses: LizardByte/LizardByte.github.io/.github/workflows/jekyll-build.yml@master
|
||||||
with:
|
|
||||||
site_artifact: 'prep'
|
|
||||||
target_branch: 'gh-pages'
|
|
||||||
clean_gh_pages: true
|
|
||||||
secrets:
|
secrets:
|
||||||
GH_BOT_EMAIL: ${{ secrets.GH_BOT_EMAIL }}
|
GH_BOT_EMAIL: ${{ secrets.GH_BOT_EMAIL }}
|
||||||
GH_BOT_NAME: ${{ secrets.GH_BOT_NAME }}
|
GH_BOT_NAME: ${{ secrets.GH_BOT_NAME }}
|
||||||
GH_BOT_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
|
GH_BOT_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
|
||||||
|
with:
|
||||||
|
clean_gh_pages: true
|
||||||
|
site_artifact: 'prep'
|
||||||
|
target_branch: 'gh-pages'
|
||||||
|
|||||||
21
.github/workflows/update-winget-release.yml
vendored
21
.github/workflows/update-winget-release.yml
vendored
@@ -1,15 +1,20 @@
|
|||||||
---
|
---
|
||||||
# This action is a candidate to centrally manage in https://github.com/<organization>/.github/
|
# This workflow is centrally managed in https://github.com/<organization>/.github/
|
||||||
# If more Winget applications are developed, consider moving this action to the organization's .github repository,
|
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||||
# using the `winget-pkg` repository label to identify repositories that should trigger this workflow.
|
# 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.
|
# Update Winget on release events.
|
||||||
|
|
||||||
name: Update Winget release
|
name: Update Winget release
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
types: [released]
|
types:
|
||||||
|
- released
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: "${{ github.workflow }}-${{ github.event.release.tag_name }}"
|
group: "${{ github.workflow }}-${{ github.event.release.tag_name }}"
|
||||||
@@ -17,14 +22,13 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update-winget-release:
|
update-winget-release:
|
||||||
if: >-
|
if: github.repository_owner == 'LizardByte'
|
||||||
github.repository_owner == 'LizardByte'
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Check if Winget repo
|
- name: Check if Winget repo
|
||||||
|
id: check-label
|
||||||
env:
|
env:
|
||||||
TOPIC: winget-pkg
|
TOPIC: winget-pkg
|
||||||
id: check-label
|
|
||||||
uses: actions/github-script@v7
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
@@ -44,8 +48,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Download release asset
|
- name: Download release asset
|
||||||
id: download
|
id: download
|
||||||
if: >-
|
if: steps.check-label.outputs.hasTopic == 'true'
|
||||||
steps.check-label.outputs.hasTopic == 'true'
|
|
||||||
uses: robinraju/release-downloader@v1.12
|
uses: robinraju/release-downloader@v1.12
|
||||||
with:
|
with:
|
||||||
repository: "${{ github.repository }}"
|
repository: "${{ github.repository }}"
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
Babel==2.17.0
|
Babel==2.17.0
|
||||||
clang-format
|
clang-format==20.*
|
||||||
|
|||||||
@@ -414,12 +414,7 @@ namespace config {
|
|||||||
auto final_resolution = entry.template get_optional<std::string>("final_resolution"s);
|
auto final_resolution = entry.template get_optional<std::string>("final_resolution"s);
|
||||||
auto final_refresh_rate = entry.template get_optional<std::string>("final_refresh_rate"s);
|
auto final_refresh_rate = entry.template get_optional<std::string>("final_refresh_rate"s);
|
||||||
|
|
||||||
output_field.push_back(video_t::dd_t::mode_remapping_entry_t {
|
output_field.push_back(video_t::dd_t::mode_remapping_entry_t {requested_resolution.value_or(""), requested_fps.value_or(""), final_resolution.value_or(""), final_refresh_rate.value_or("")});
|
||||||
requested_resolution.value_or(""),
|
|
||||||
requested_fps.value_or(""),
|
|
||||||
final_resolution.value_or(""),
|
|
||||||
final_refresh_rate.value_or("")
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ namespace net {
|
|||||||
|
|
||||||
std::uint16_t map_port(int port) {
|
std::uint16_t map_port(int port) {
|
||||||
// calculate the port from the config port
|
// calculate the port from the config port
|
||||||
auto mapped_port = (std::uint16_t)((int) config::sunshine.port + port);
|
auto mapped_port = (std::uint16_t) ((int) config::sunshine.port + port);
|
||||||
|
|
||||||
// Ensure port is in the range of 1024-65535
|
// Ensure port is in the range of 1024-65535
|
||||||
if (mapped_port < 1024 || mapped_port > 65535) {
|
if (mapped_port < 1024 || mapped_port > 65535) {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ extern "C" {
|
|||||||
// There aren't that many DRM_FORMAT I need to use, so define them here
|
// There aren't that many DRM_FORMAT I need to use, so define them here
|
||||||
//
|
//
|
||||||
// They aren't likely to change any time soon.
|
// They aren't likely to change any time soon.
|
||||||
#define fourcc_code(a, b, c, d) ((std::uint32_t)(a) | ((std::uint32_t)(b) << 8) | ((std::uint32_t)(c) << 16) | ((std::uint32_t)(d) << 24))
|
#define fourcc_code(a, b, c, d) ((std::uint32_t) (a) | ((std::uint32_t) (b) << 8) | ((std::uint32_t) (c) << 16) | ((std::uint32_t) (d) << 24))
|
||||||
#define fourcc_mod_code(vendor, val) ((((uint64_t) vendor) << 56) | ((val) & 0x00ffffffffffffffULL))
|
#define fourcc_mod_code(vendor, val) ((((uint64_t) vendor) << 56) | ((val) & 0x00ffffffffffffffULL))
|
||||||
#define DRM_FORMAT_MOD_INVALID fourcc_mod_code(0, ((1ULL << 56) - 1))
|
#define DRM_FORMAT_MOD_INVALID fourcc_mod_code(0, ((1ULL << 56) - 1))
|
||||||
|
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ namespace platf::dxgi {
|
|||||||
{
|
{
|
||||||
util::buffer_t<std::uint8_t> cursor_img = img_data;
|
util::buffer_t<std::uint8_t> cursor_img = img_data;
|
||||||
std::for_each((std::uint32_t *) std::begin(cursor_img), (std::uint32_t *) std::end(cursor_img), [](auto &pixel) {
|
std::for_each((std::uint32_t *) std::begin(cursor_img), (std::uint32_t *) std::end(cursor_img), [](auto &pixel) {
|
||||||
auto alpha = (std::uint8_t)((pixel >> 24) & 0xFF);
|
auto alpha = (std::uint8_t) ((pixel >> 24) & 0xFF);
|
||||||
if (alpha == 0xFF) {
|
if (alpha == 0xFF) {
|
||||||
// Pixels with 0xFF alpha will be XOR-blended as is.
|
// Pixels with 0xFF alpha will be XOR-blended as is.
|
||||||
} else if (alpha == 0x00) {
|
} else if (alpha == 0x00) {
|
||||||
@@ -286,7 +286,7 @@ namespace platf::dxgi {
|
|||||||
{
|
{
|
||||||
util::buffer_t<std::uint8_t> cursor_img = img_data;
|
util::buffer_t<std::uint8_t> cursor_img = img_data;
|
||||||
std::for_each((std::uint32_t *) std::begin(cursor_img), (std::uint32_t *) std::end(cursor_img), [](auto &pixel) {
|
std::for_each((std::uint32_t *) std::begin(cursor_img), (std::uint32_t *) std::end(cursor_img), [](auto &pixel) {
|
||||||
auto alpha = (std::uint8_t)((pixel >> 24) & 0xFF);
|
auto alpha = (std::uint8_t) ((pixel >> 24) & 0xFF);
|
||||||
if (alpha == 0xFF) {
|
if (alpha == 0xFF) {
|
||||||
// Pixels with 0xFF alpha will be XOR-blended by make_cursor_xor_image().
|
// Pixels with 0xFF alpha will be XOR-blended by make_cursor_xor_image().
|
||||||
// We make them transparent for the alpha-blended cursor image.
|
// We make them transparent for the alpha-blended cursor image.
|
||||||
|
|||||||
@@ -92,10 +92,10 @@ namespace platf {
|
|||||||
|
|
||||||
constexpr float EARTH_G = 9.80665f;
|
constexpr float EARTH_G = 9.80665f;
|
||||||
|
|
||||||
#define MPS2_TO_DS4_ACCEL(x) (int32_t)(((x) / EARTH_G) * 8192)
|
#define MPS2_TO_DS4_ACCEL(x) (int32_t) (((x) / EARTH_G) * 8192)
|
||||||
#define DPS_TO_DS4_GYRO(x) (int32_t)((x) * (1024 / 64))
|
#define DPS_TO_DS4_GYRO(x) (int32_t) ((x) * (1024 / 64))
|
||||||
|
|
||||||
#define APPLY_CALIBRATION(val, bias, scale) (int32_t)(((float) (val) + (bias)) / (scale))
|
#define APPLY_CALIBRATION(val, bias, scale) (int32_t) (((float) (val) + (bias)) / (scale))
|
||||||
|
|
||||||
constexpr DS4_TOUCH ds4_touch_unused = {
|
constexpr DS4_TOUCH ds4_touch_unused = {
|
||||||
.bPacketCounter = 0,
|
.bPacketCounter = 0,
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ namespace rtsp_stream {
|
|||||||
boost::asio::async_read(sock, boost::asio::buffer(begin, sizeof(encrypted_rtsp_header_t)), boost::bind(&socket_t::handle_read_encrypted_header, shared_from_this(), boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred));
|
boost::asio::async_read(sock, boost::asio::buffer(begin, sizeof(encrypted_rtsp_header_t)), boost::bind(&socket_t::handle_read_encrypted_header, shared_from_this(), boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred));
|
||||||
} else {
|
} else {
|
||||||
sock.async_read_some(
|
sock.async_read_some(
|
||||||
boost::asio::buffer(begin, (std::size_t)(std::end(msg_buf) - begin)),
|
boost::asio::buffer(begin, (std::size_t) (std::end(msg_buf) - begin)),
|
||||||
boost::bind(
|
boost::bind(
|
||||||
&socket_t::handle_read_plaintext,
|
&socket_t::handle_read_plaintext,
|
||||||
shared_from_this(),
|
shared_from_this(),
|
||||||
@@ -253,7 +253,7 @@ namespace rtsp_stream {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sock.async_read_some(
|
sock.async_read_some(
|
||||||
boost::asio::buffer(begin, (std::size_t)(std::end(msg_buf) - begin)),
|
boost::asio::buffer(begin, (std::size_t) (std::end(msg_buf) - begin)),
|
||||||
boost::bind(
|
boost::bind(
|
||||||
&socket_t::handle_plaintext_payload,
|
&socket_t::handle_plaintext_payload,
|
||||||
shared_from_this(),
|
shared_from_this(),
|
||||||
@@ -289,7 +289,7 @@ namespace rtsp_stream {
|
|||||||
|
|
||||||
auto end = socket->begin + bytes;
|
auto end = socket->begin + bytes;
|
||||||
msg_t req {new msg_t::element_type {}};
|
msg_t req {new msg_t::element_type {}};
|
||||||
if (auto status = parseRtspMessage(req.get(), socket->msg_buf.data(), (std::size_t)(end - socket->msg_buf.data()))) {
|
if (auto status = parseRtspMessage(req.get(), socket->msg_buf.data(), (std::size_t) (end - socket->msg_buf.data()))) {
|
||||||
BOOST_LOG(error) << "Malformed RTSP message: ["sv << status << ']';
|
BOOST_LOG(error) << "Malformed RTSP message: ["sv << status << ']';
|
||||||
|
|
||||||
respond(socket->sock, *socket->session, nullptr, 400, "BAD REQUEST", 0, {});
|
respond(socket->sock, *socket->session, nullptr, 400, "BAD REQUEST", 0, {});
|
||||||
@@ -321,7 +321,7 @@ namespace rtsp_stream {
|
|||||||
|
|
||||||
if (end - socket->crlf >= content_length) {
|
if (end - socket->crlf >= content_length) {
|
||||||
if (end - socket->crlf > content_length) {
|
if (end - socket->crlf > content_length) {
|
||||||
BOOST_LOG(warning) << "(end - socket->crlf) > content_length -- "sv << (std::size_t)(end - socket->crlf) << " > "sv << content_length;
|
BOOST_LOG(warning) << "(end - socket->crlf) > content_length -- "sv << (std::size_t) (end - socket->crlf) << " > "sv << content_length;
|
||||||
}
|
}
|
||||||
|
|
||||||
fg.disable();
|
fg.disable();
|
||||||
|
|||||||
@@ -375,7 +375,7 @@ namespace util {
|
|||||||
return (std::uint8_t) ch - '0';
|
return (std::uint8_t) ch - '0';
|
||||||
}
|
}
|
||||||
|
|
||||||
return (std::uint8_t)(ch | (char) 32) - 'a' + (char) 10;
|
return (std::uint8_t) (ch | (char) 32) - 'a' + (char) 10;
|
||||||
};
|
};
|
||||||
|
|
||||||
std::fill_n(buf + buf_size, padding, 0);
|
std::fill_n(buf + buf_size, padding, 0);
|
||||||
@@ -429,7 +429,7 @@ namespace util {
|
|||||||
return (std::uint8_t) ch - '0';
|
return (std::uint8_t) ch - '0';
|
||||||
}
|
}
|
||||||
|
|
||||||
return (std::uint8_t)(ch | (char) 32) - 'a' + (char) 10;
|
return (std::uint8_t) (ch | (char) 32) - 'a' + (char) 10;
|
||||||
};
|
};
|
||||||
|
|
||||||
for (auto &el : buf) {
|
for (auto &el : buf) {
|
||||||
@@ -483,12 +483,12 @@ namespace util {
|
|||||||
std::int64_t res {};
|
std::int64_t res {};
|
||||||
std::int64_t mul = 1;
|
std::int64_t mul = 1;
|
||||||
while (begin != --end) {
|
while (begin != --end) {
|
||||||
res += (std::int64_t)(*end - '0') * mul;
|
res += (std::int64_t) (*end - '0') * mul;
|
||||||
|
|
||||||
mul *= 10;
|
mul *= 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
return *begin != '-' ? res + (std::int64_t)(*begin - '0') * mul : -res;
|
return *begin != '-' ? res + (std::int64_t) (*begin - '0') * mul : -res;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline std::int64_t from_view(const std::string_view &number) {
|
inline std::int64_t from_view(const std::string_view &number) {
|
||||||
@@ -955,7 +955,7 @@ namespace util {
|
|||||||
|
|
||||||
template<class It>
|
template<class It>
|
||||||
std::string_view view(It begin, It end) {
|
std::string_view view(It begin, It end) {
|
||||||
return std::string_view {(const char *) begin, (std::size_t)(end - begin)};
|
return std::string_view {(const char *) begin, (std::size_t) (end - begin)};
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
|
|||||||
Reference in New Issue
Block a user