mirror of
https://github.com/LizardByte/Sunshine.git
synced 2026-02-04 13:25:42 +00:00
ci: use actionlint and problem matchers (#4116)
This commit is contained in:
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
|
||||||
*.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
|
*flatpak-lint-*.json text eol=lf
|
||||||
|
*.sh text eol=lf
|
||||||
|
|||||||
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
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
4
.github/workflows/ci-copr.yml
vendored
4
.github/workflows/ci-copr.yml
vendored
@ -16,6 +16,10 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
COPR_CLI_CONFIG:
|
COPR_CLI_CONFIG:
|
||||||
required: false
|
required: false
|
||||||
|
GH_BOT_TOKEN:
|
||||||
|
required: false
|
||||||
|
VIRUSTOTAL_API_KEY:
|
||||||
|
required: false
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: "_${{ github.workflow }}-${{ github.ref }}"
|
group: "_${{ github.workflow }}-${{ github.ref }}"
|
||||||
|
|||||||
41
.github/workflows/ci-flatpak.yml
vendored
41
.github/workflows/ci-flatpak.yml
vendored
@ -73,15 +73,16 @@ jobs:
|
|||||||
cmake \
|
cmake \
|
||||||
flatpak
|
flatpak
|
||||||
|
|
||||||
sudo su $(whoami) -c "flatpak --user remote-add --if-not-exists flathub \
|
sudo su "$(whoami)" -c "flatpak --user remote-add --if-not-exists flathub \
|
||||||
https://flathub.org/repo/flathub.flatpakrepo"
|
https://flathub.org/repo/flathub.flatpakrepo
|
||||||
|
"
|
||||||
|
|
||||||
sudo su $(whoami) -c "flatpak --user install -y flathub \
|
sudo su "$(whoami)" -c "flatpak --user install -y flathub \
|
||||||
org.flatpak.Builder \
|
org.flatpak.Builder \
|
||||||
org.freedesktop.Platform/${{ matrix.arch }}/${PLATFORM_VERSION} \
|
org.freedesktop.Platform/${{ matrix.arch }}/${PLATFORM_VERSION} \
|
||||||
org.freedesktop.Sdk/${{ matrix.arch }}/${PLATFORM_VERSION} \
|
org.freedesktop.Sdk/${{ matrix.arch }}/${PLATFORM_VERSION} \
|
||||||
org.freedesktop.Sdk.Extension.node${NODE_VERSION}/${{ matrix.arch }}/${PLATFORM_VERSION} \
|
org.freedesktop.Sdk.Extension.node${NODE_VERSION}/${{ matrix.arch }}/${PLATFORM_VERSION} \
|
||||||
"
|
"
|
||||||
|
|
||||||
flatpak run org.flatpak.Builder --version
|
flatpak run org.flatpak.Builder --version
|
||||||
|
|
||||||
@ -101,9 +102,11 @@ jobs:
|
|||||||
flatpak-${{ matrix.arch }}-
|
flatpak-${{ matrix.arch }}-
|
||||||
|
|
||||||
- name: Configure Flatpak Manifest
|
- name: Configure Flatpak Manifest
|
||||||
|
env:
|
||||||
|
BRANCH: ${{ github.head_ref }}
|
||||||
run: |
|
run: |
|
||||||
# variables for manifest
|
# variables for manifest
|
||||||
branch="${{ github.head_ref }}"
|
branch="${{ env.BRANCH }}"
|
||||||
build_version=${{ inputs.release_version }}
|
build_version=${{ inputs.release_version }}
|
||||||
commit=${{ inputs.release_commit }}
|
commit=${{ inputs.release_commit }}
|
||||||
|
|
||||||
@ -137,19 +140,20 @@ jobs:
|
|||||||
|
|
||||||
- name: Debug Manifest
|
- name: Debug Manifest
|
||||||
working-directory: build
|
working-directory: build
|
||||||
run: cat ${APP_ID}.yml
|
run: cat "${APP_ID}.yml"
|
||||||
|
|
||||||
- name: Build Linux Flatpak
|
- name: Build Linux Flatpak
|
||||||
working-directory: build
|
working-directory: build
|
||||||
run: |
|
run: |
|
||||||
sudo su $(whoami) -c "flatpak run org.flatpak.Builder \
|
echo "::add-matcher::.github/matchers/gcc-strip3.json"
|
||||||
|
sudo su "$(whoami)" -c "flatpak run org.flatpak.Builder \
|
||||||
--arch=${{ matrix.arch }} \
|
--arch=${{ matrix.arch }} \
|
||||||
--force-clean \
|
--force-clean \
|
||||||
--repo=repo \
|
--repo=repo \
|
||||||
--sandbox \
|
--sandbox \
|
||||||
--stop-at=cuda build-sunshine ${APP_ID}.yml"
|
--stop-at=cuda build-sunshine ${APP_ID}.yml"
|
||||||
cp -r .flatpak-builder copy-of-flatpak-builder
|
cp -r .flatpak-builder copy-of-flatpak-builder
|
||||||
sudo su $(whoami) -c "flatpak run org.flatpak.Builder \
|
sudo su "$(whoami)" -c "flatpak run org.flatpak.Builder \
|
||||||
--arch=${{ matrix.arch }} \
|
--arch=${{ matrix.arch }} \
|
||||||
--force-clean \
|
--force-clean \
|
||||||
--repo=repo \
|
--repo=repo \
|
||||||
@ -157,15 +161,16 @@ jobs:
|
|||||||
build-sunshine ${APP_ID}.yml"
|
build-sunshine ${APP_ID}.yml"
|
||||||
rm -rf .flatpak-builder
|
rm -rf .flatpak-builder
|
||||||
mv copy-of-flatpak-builder .flatpak-builder
|
mv copy-of-flatpak-builder .flatpak-builder
|
||||||
sudo su $(whoami) -c "flatpak build-bundle \
|
sudo su "$(whoami)" -c "flatpak build-bundle \
|
||||||
--arch=${{ matrix.arch }} \
|
--arch=${{ matrix.arch }} \
|
||||||
./repo \
|
./repo \
|
||||||
../artifacts/sunshine_${{ matrix.arch }}.flatpak ${APP_ID}"
|
../artifacts/sunshine_${{ matrix.arch }}.flatpak ${APP_ID}"
|
||||||
sudo su $(whoami) -c "flatpak build-bundle \
|
sudo su "$(whoami)" -c "flatpak build-bundle \
|
||||||
--runtime \
|
--runtime \
|
||||||
--arch=${{ matrix.arch }} \
|
--arch=${{ matrix.arch }} \
|
||||||
./repo \
|
./repo \
|
||||||
../artifacts/sunshine_debug_${{ matrix.arch }}.flatpak ${APP_ID}.Debug"
|
../artifacts/sunshine_debug_${{ matrix.arch }}.flatpak ${APP_ID}.Debug"
|
||||||
|
echo "::remove-matcher owner=gcc-strip3::"
|
||||||
|
|
||||||
- name: Lint Flatpak
|
- name: Lint Flatpak
|
||||||
working-directory: build
|
working-directory: build
|
||||||
@ -177,7 +182,7 @@ jobs:
|
|||||||
--exceptions \
|
--exceptions \
|
||||||
--user-exceptions "${exceptions_file}" \
|
--user-exceptions "${exceptions_file}" \
|
||||||
manifest \
|
manifest \
|
||||||
${APP_ID}.yml
|
"${APP_ID}.yml"
|
||||||
|
|
||||||
echo "Linting flatpak repo"
|
echo "Linting flatpak repo"
|
||||||
# TODO: add arg
|
# TODO: add arg
|
||||||
@ -193,13 +198,13 @@ jobs:
|
|||||||
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/"
|
||||||
cp ./build/package-lock.json ./flathub/
|
cp "./build/package-lock.json" "./flathub/"
|
||||||
cp ./build/${APP_ID}.yml ./flathub/
|
cp "./build/${APP_ID}.yml" "./flathub/"
|
||||||
cp ./build/${APP_ID}.metainfo.xml ./flathub/
|
cp "./build/${APP_ID}.metainfo.xml" "./flathub/"
|
||||||
cp ./packaging/linux/flatpak/README.md ./flathub/
|
cp "./packaging/linux/flatpak/README.md" "./flathub/"
|
||||||
cp ./packaging/linux/flatpak/flathub.json ./flathub/
|
cp "./packaging/linux/flatpak/flathub.json" "./flathub/"
|
||||||
cp -r ./packaging/linux/flatpak/modules/. ./flathub/modules/
|
cp -r "./packaging/linux/flatpak/modules/." "./flathub/modules/"
|
||||||
# submodules will need to be handled in the workflow that creates the PR
|
# submodules will need to be handled in the workflow that creates the PR
|
||||||
|
|
||||||
# create the archive
|
# create the archive
|
||||||
|
|||||||
16
.github/workflows/ci-homebrew.yml
vendored
16
.github/workflows/ci-homebrew.yml
vendored
@ -73,9 +73,13 @@ jobs:
|
|||||||
brew install python3
|
brew install python3
|
||||||
|
|
||||||
- name: Configure formula
|
- 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: |
|
run: |
|
||||||
# variables for formula
|
# variables for formula
|
||||||
branch="${{ github.head_ref }}"
|
branch="${{ env.HEAD_REF }}"
|
||||||
build_version=${{ inputs.release_version }}
|
build_version=${{ inputs.release_version }}
|
||||||
commit=${{ inputs.release_commit }}
|
commit=${{ inputs.release_commit }}
|
||||||
|
|
||||||
@ -96,9 +100,9 @@ jobs:
|
|||||||
else
|
else
|
||||||
echo "This is a PR event"
|
echo "This is a PR event"
|
||||||
clone_url=${{ github.event.pull_request.head.repo.clone_url }}
|
clone_url=${{ github.event.pull_request.head.repo.clone_url }}
|
||||||
branch="${{ github.event.pull_request.head.ref }}"
|
branch="${{ env.PR_HEAD_REF }}"
|
||||||
default_branch="${{ github.event.pull_request.head.repo.default_branch }}"
|
default_branch="${{ env.PR_DEFAULT_BRANCH }}"
|
||||||
tag="${{ github.event.pull_request.head.ref }}"
|
tag="${{ env.PR_HEAD_REF }}"
|
||||||
fi
|
fi
|
||||||
echo "Branch: ${branch}"
|
echo "Branch: ${branch}"
|
||||||
echo "Clone URL: ${clone_url}"
|
echo "Clone URL: ${clone_url}"
|
||||||
@ -143,8 +147,9 @@ jobs:
|
|||||||
export DISPLAY=:1
|
export DISPLAY=:1
|
||||||
Xvfb ${DISPLAY} -screen 0 1024x768x24 &
|
Xvfb ${DISPLAY} -screen 0 1024x768x24 &
|
||||||
|
|
||||||
echo "DISPLAY=${DISPLAY}" >> $GITHUB_ENV
|
echo "DISPLAY=${DISPLAY}" >> "${GITHUB_ENV}"
|
||||||
|
|
||||||
|
- run: echo "::add-matcher::.github/matchers/gcc-strip3.json"
|
||||||
- name: Validate Homebrew Formula
|
- name: Validate Homebrew Formula
|
||||||
id: test
|
id: test
|
||||||
if: matrix.release != true
|
if: matrix.release != true
|
||||||
@ -156,6 +161,7 @@ jobs:
|
|||||||
publish: false
|
publish: false
|
||||||
token: ${{ secrets.GH_TOKEN }}
|
token: ${{ secrets.GH_TOKEN }}
|
||||||
validate: true
|
validate: true
|
||||||
|
- run: echo "::remove-matcher owner=gcc-strip3::"
|
||||||
|
|
||||||
- name: Setup python
|
- name: Setup python
|
||||||
id: python
|
id: python
|
||||||
|
|||||||
8
.github/workflows/ci-linux.yml
vendored
8
.github/workflows/ci-linux.yml
vendored
@ -79,8 +79,8 @@ jobs:
|
|||||||
--enable-x11 \
|
--enable-x11 \
|
||||||
--enable-glx \
|
--enable-glx \
|
||||||
--enable-wayland \
|
--enable-wayland \
|
||||||
--without-legacy # emgd, nvctrl, fglrx
|
--without-legacy
|
||||||
make -j $(nproc)
|
make -j "$(nproc)"
|
||||||
sudo make install
|
sudo make install
|
||||||
cd .. && rm -rf libva-*
|
cd .. && rm -rf libva-*
|
||||||
|
|
||||||
@ -91,6 +91,7 @@ jobs:
|
|||||||
COMMIT: ${{ inputs.release_commit }}
|
COMMIT: ${{ inputs.release_commit }}
|
||||||
run: |
|
run: |
|
||||||
chmod +x ./scripts/linux_build.sh
|
chmod +x ./scripts/linux_build.sh
|
||||||
|
echo "::add-matcher::.github/matchers/gcc.json"
|
||||||
./scripts/linux_build.sh \
|
./scripts/linux_build.sh \
|
||||||
--publisher-name='${{ github.repository_owner }}' \
|
--publisher-name='${{ github.repository_owner }}' \
|
||||||
--publisher-website='https://app.lizardbyte.dev' \
|
--publisher-website='https://app.lizardbyte.dev' \
|
||||||
@ -98,12 +99,13 @@ jobs:
|
|||||||
--skip-cleanup \
|
--skip-cleanup \
|
||||||
--skip-package \
|
--skip-package \
|
||||||
--ubuntu-test-repo ${{ matrix.EXTRA_ARGS }}
|
--ubuntu-test-repo ${{ matrix.EXTRA_ARGS }}
|
||||||
|
echo "::remove-matcher owner=gcc::"
|
||||||
|
|
||||||
- name: Set AppImage Version
|
- name: Set AppImage Version
|
||||||
if: matrix.name == 'AppImage'
|
if: matrix.name == 'AppImage'
|
||||||
run: |
|
run: |
|
||||||
version=${{ inputs.release_version }}
|
version=${{ inputs.release_version }}
|
||||||
echo "VERSION=${version}" >> $GITHUB_ENV
|
echo "VERSION=${version}" >> "${GITHUB_ENV}"
|
||||||
|
|
||||||
- name: Package Linux - AppImage
|
- name: Package Linux - AppImage
|
||||||
if: matrix.name == 'AppImage'
|
if: matrix.name == 'AppImage'
|
||||||
|
|||||||
10
.github/workflows/ci-windows.yml
vendored
10
.github/workflows/ci-windows.yml
vendored
@ -199,12 +199,12 @@ jobs:
|
|||||||
ignore_list=$(IFS=,; echo "${ignore_packages[*]}")
|
ignore_list=$(IFS=,; echo "${ignore_packages[*]}")
|
||||||
|
|
||||||
# install pinned dependencies
|
# install pinned dependencies
|
||||||
if [ -n "$tarballs" ]; then
|
if [ -n "${tarballs}" ]; then
|
||||||
pacman -U --noconfirm ${tarballs}
|
pacman -U --noconfirm "${tarballs}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Only add --ignore if we have packages to ignore
|
# Only add --ignore if we have packages to ignore
|
||||||
if [ -n "$ignore_list" ]; then
|
if [ -n "${ignore_list}" ]; then
|
||||||
pacman -Syu --noconfirm --ignore="${ignore_list}" "${dependencies[@]}"
|
pacman -Syu --noconfirm --ignore="${ignore_list}" "${dependencies[@]}"
|
||||||
else
|
else
|
||||||
pacman -Syu --noconfirm "${dependencies[@]}"
|
pacman -Syu --noconfirm "${dependencies[@]}"
|
||||||
@ -251,7 +251,7 @@ jobs:
|
|||||||
|
|
||||||
# step output
|
# step output
|
||||||
echo "python-path=${python_path}"
|
echo "python-path=${python_path}"
|
||||||
echo "python-path=${python_path}" >> $GITHUB_OUTPUT
|
echo "python-path=${python_path}" >> "${GITHUB_OUTPUT}"
|
||||||
|
|
||||||
- name: Build Windows
|
- name: Build Windows
|
||||||
shell: msys2 {0}
|
shell: msys2 {0}
|
||||||
@ -272,7 +272,9 @@ jobs:
|
|||||||
-DSUNSHINE_PUBLISHER_NAME='${{ github.repository_owner }}' \
|
-DSUNSHINE_PUBLISHER_NAME='${{ github.repository_owner }}' \
|
||||||
-DSUNSHINE_PUBLISHER_WEBSITE='https://app.lizardbyte.dev' \
|
-DSUNSHINE_PUBLISHER_WEBSITE='https://app.lizardbyte.dev' \
|
||||||
-DSUNSHINE_PUBLISHER_ISSUE_URL='https://app.lizardbyte.dev/support'
|
-DSUNSHINE_PUBLISHER_ISSUE_URL='https://app.lizardbyte.dev/support'
|
||||||
|
echo "::add-matcher::.github/matchers/gcc.json"
|
||||||
ninja -C build
|
ninja -C build
|
||||||
|
echo "::remove-matcher owner=gcc::"
|
||||||
|
|
||||||
- name: Package Windows
|
- name: Package Windows
|
||||||
shell: msys2 {0}
|
shell: msys2 {0}
|
||||||
|
|||||||
8
.github/workflows/localize.yml
vendored
8
.github/workflows/localize.yml
vendored
@ -48,9 +48,9 @@ jobs:
|
|||||||
if [ -f "${{ env.file }}" ];
|
if [ -f "${{ env.file }}" ];
|
||||||
then
|
then
|
||||||
rm ${{ env.file }}
|
rm ${{ env.file }}
|
||||||
echo "new_file=false" >> $GITHUB_ENV
|
echo "new_file=false" >> "${GITHUB_ENV}"
|
||||||
else
|
else
|
||||||
echo "new_file=true" >> $GITHUB_ENV
|
echo "new_file=true" >> "${GITHUB_ENV}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# extract the new strings
|
# extract the new strings
|
||||||
@ -67,7 +67,7 @@ jobs:
|
|||||||
|
|
||||||
# set the variable with minimal output, replacing `\t` with ` `
|
# set the variable with minimal output, replacing `\t` with ` `
|
||||||
OUTPUT=$(git diff --numstat locale/sunshine.po | sed -e "s#\t# #g")
|
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
|
- 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
|
||||||
@ -79,7 +79,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get current date
|
- name: Get current date
|
||||||
id: 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
|
- name: Create/Update Pull Request
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v7
|
||||||
|
|||||||
@ -1,18 +1,18 @@
|
|||||||
# Set build variables if env variables are defined
|
# Set build variables if env variables are defined
|
||||||
# These are used in configured files such as manifests for different packages
|
# These are used in configured files such as manifests for different packages
|
||||||
if(DEFINED ENV{BRANCH}) # cmake-lint: disable=W0106
|
if(DEFINED ENV{BRANCH})
|
||||||
set(GITHUB_BRANCH $ENV{BRANCH})
|
set(GITHUB_BRANCH $ENV{BRANCH})
|
||||||
endif()
|
endif()
|
||||||
if(DEFINED ENV{BUILD_VERSION}) # cmake-lint: disable=W0106
|
if(DEFINED ENV{BUILD_VERSION}) # cmake-lint: disable=W0106
|
||||||
set(BUILD_VERSION $ENV{BUILD_VERSION})
|
set(BUILD_VERSION $ENV{BUILD_VERSION})
|
||||||
endif()
|
endif()
|
||||||
if(DEFINED ENV{CLONE_URL}) # cmake-lint: disable=W0106
|
if(DEFINED ENV{CLONE_URL})
|
||||||
set(GITHUB_CLONE_URL $ENV{CLONE_URL})
|
set(GITHUB_CLONE_URL $ENV{CLONE_URL})
|
||||||
endif()
|
endif()
|
||||||
if(DEFINED ENV{COMMIT}) # cmake-lint: disable=W0106
|
if(DEFINED ENV{COMMIT})
|
||||||
set(GITHUB_COMMIT $ENV{COMMIT})
|
set(GITHUB_COMMIT $ENV{COMMIT})
|
||||||
endif()
|
endif()
|
||||||
if(DEFINED ENV{TAG}) # cmake-lint: disable=W0106
|
if(DEFINED ENV{TAG})
|
||||||
set(GITHUB_TAG $ENV{TAG})
|
set(GITHUB_TAG $ENV{TAG})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
@ -32,7 +32,6 @@ ENV CLONE_URL=${CLONE_URL}
|
|||||||
|
|
||||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||||
|
|
||||||
# hadolint ignore=SC2016
|
|
||||||
RUN <<_SETUP
|
RUN <<_SETUP
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
@ -42,6 +41,7 @@ useradd -m builder
|
|||||||
echo 'builder ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
|
echo 'builder ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
|
||||||
|
|
||||||
# patch the build flags
|
# patch the build flags
|
||||||
|
# shellcheck disable=SC2016
|
||||||
sed -i 's,#MAKEFLAGS="-j2",MAKEFLAGS="-j$(nproc)",g' /etc/makepkg.conf
|
sed -i 's,#MAKEFLAGS="-j2",MAKEFLAGS="-j$(nproc)",g' /etc/makepkg.conf
|
||||||
|
|
||||||
# install dependencies
|
# install dependencies
|
||||||
|
|||||||
@ -19,7 +19,6 @@ ENV DISPLAY=:0
|
|||||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||||
|
|
||||||
# install dependencies
|
# install dependencies
|
||||||
# hadolint ignore=SC1091
|
|
||||||
RUN <<_DEPS
|
RUN <<_DEPS
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
@ -74,7 +73,6 @@ WORKDIR /build/cuda
|
|||||||
# versions: https://developer.nvidia.com/cuda-toolkit-archive
|
# versions: https://developer.nvidia.com/cuda-toolkit-archive
|
||||||
ENV CUDA_VERSION="11.8.0"
|
ENV CUDA_VERSION="11.8.0"
|
||||||
ENV CUDA_BUILD="520.61.05"
|
ENV CUDA_BUILD="520.61.05"
|
||||||
# hadolint ignore=SC3010
|
|
||||||
RUN <<_INSTALL_CUDA
|
RUN <<_INSTALL_CUDA
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|||||||
@ -42,7 +42,6 @@ _BUILD
|
|||||||
|
|
||||||
# run tests
|
# run tests
|
||||||
WORKDIR /build/sunshine/build/tests
|
WORKDIR /build/sunshine/build/tests
|
||||||
# hadolint ignore=SC1091
|
|
||||||
RUN <<_TEST
|
RUN <<_TEST
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|||||||
@ -42,7 +42,6 @@ _BUILD
|
|||||||
|
|
||||||
# run tests
|
# run tests
|
||||||
WORKDIR /build/sunshine/build/tests
|
WORKDIR /build/sunshine/build/tests
|
||||||
# hadolint ignore=SC1091
|
|
||||||
RUN <<_TEST
|
RUN <<_TEST
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|||||||
@ -42,7 +42,6 @@ _BUILD
|
|||||||
|
|
||||||
# run tests
|
# run tests
|
||||||
WORKDIR /build/sunshine/build/tests
|
WORKDIR /build/sunshine/build/tests
|
||||||
# hadolint ignore=SC1091
|
|
||||||
RUN <<_TEST
|
RUN <<_TEST
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|||||||
@ -97,9 +97,6 @@ tar -xzf %{SOURCE0} -C %{_builddir}/Sunshine
|
|||||||
# list directory
|
# list directory
|
||||||
ls -a %{_builddir}/Sunshine
|
ls -a %{_builddir}/Sunshine
|
||||||
|
|
||||||
# patches
|
|
||||||
%autopatch -p1
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
# exit on error
|
# exit on error
|
||||||
set -e
|
set -e
|
||||||
|
|||||||
@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
# User Service
|
# User Service
|
||||||
mkdir -p ~/.config/systemd/user
|
mkdir -p ~/.config/systemd/user
|
||||||
cp /app/share/sunshine/systemd/user/sunshine.service $HOME/.config/systemd/user/sunshine.service
|
cp "/app/share/sunshine/systemd/user/sunshine.service" "$HOME/.config/systemd/user/sunshine.service"
|
||||||
echo Sunshine User Service has been installed.
|
echo "Sunshine User Service has been installed."
|
||||||
echo Use [systemctl --user enable sunshine] once to autostart Sunshine on login.
|
echo "Use [systemctl --user enable sunshine] once to autostart Sunshine on login."
|
||||||
|
|
||||||
# Udev rule
|
# Udev rule
|
||||||
UDEV=$(cat /app/share/sunshine/udev/rules.d/60-sunshine.rules)
|
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"
|
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
|
# User Service
|
||||||
systemctl --user stop sunshine
|
systemctl --user stop sunshine
|
||||||
rm $HOME/.config/systemd/user/sunshine.service
|
rm "$HOME/.config/systemd/user/sunshine.service"
|
||||||
systemctl --user daemon-reload
|
systemctl --user daemon-reload
|
||||||
echo Sunshine User Service has been removed.
|
echo "Sunshine User Service has been removed."
|
||||||
|
|
||||||
# Udev rule
|
# Udev rule
|
||||||
flatpak-spawn --host pkexec sh -c "rm /etc/udev/rules.d/60-sunshine.rules"
|
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,61 +1,63 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if ! [ -x "$(command -v ./go-png2ico)" ]; then
|
if ! [ -x "$(command -v ./go-png2ico)" ]; then
|
||||||
echo "./go-png2ico not found"
|
echo "./go-png2ico not found"
|
||||||
echo "download the executable from https://github.com/J-Siu/go-png2ico"
|
echo "download the executable from https://github.com/J-Siu/go-png2ico"
|
||||||
echo "and drop it in this folder"
|
echo "and drop it in this folder"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! [ -x "$(command -v ./oxipng)" ]; then
|
if ! [ -x "$(command -v ./oxipng)" ]; then
|
||||||
echo "./oxipng executable not found"
|
echo "./oxipng executable not found"
|
||||||
echo "download the executable from https://github.com/shssoichiro/oxipng"
|
echo "download the executable from https://github.com/shssoichiro/oxipng"
|
||||||
echo "and drop it in this folder"
|
echo "and drop it in this folder"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! [ -x "$(command -v inkscape)" ]; then
|
if ! [ -x "$(command -v inkscape)" ]; then
|
||||||
echo "inkscape executable not found"
|
echo "inkscape executable not found"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
icon_base_sizes=(16 64)
|
icon_base_sizes=(16 64)
|
||||||
icon_sizes_keys=() # associative array to prevent duplicates
|
icon_sizes_keys=() # associative array to prevent duplicates
|
||||||
icon_sizes_keys[256]=1
|
icon_sizes_keys[256]=1
|
||||||
|
|
||||||
for icon_base_size in ${icon_base_sizes[@]}; do
|
for icon_base_size in "${icon_base_sizes[@]}"; do
|
||||||
# increment in 25% till 400%
|
# increment in 25% till 400%
|
||||||
icon_size_increment=$((icon_base_size / 4))
|
icon_size_increment=$((icon_base_size / 4))
|
||||||
for ((i = 0; i <= 12; i++)); do
|
for ((i = 0; i <= 12; i++)); do
|
||||||
icon_sizes_keys[$((icon_base_size + i * icon_size_increment))]=1
|
icon_sizes_keys[icon_base_size + i * icon_size_increment]=1
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
# convert to normal array
|
# convert to normal array
|
||||||
icon_sizes=${!icon_sizes_keys[@]}
|
icon_sizes=("${!icon_sizes_keys[@]}")
|
||||||
|
|
||||||
echo "using icon sizes:"
|
echo "using icon sizes:"
|
||||||
echo ${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_vectors=("../../src_assets/common/assets/web/public/images/sunshine-locked.svg"
|
||||||
"../../src_assets/common/assets/web/public/images/sunshine-playing.svg"
|
"../../src_assets/common/assets/web/public/images/sunshine-pausing.svg"
|
||||||
"../../sunshine.svg")
|
"../../src_assets/common/assets/web/public/images/sunshine-playing.svg"
|
||||||
|
"../../sunshine.svg")
|
||||||
echo "using sources vectors:"
|
|
||||||
echo ${src_vectors[@]}
|
echo "using sources vectors:"
|
||||||
|
# shellcheck disable=SC2068 # intentionally word split
|
||||||
for src_vector in ${src_vectors[@]}; do
|
echo ${src_vectors[@]}
|
||||||
file_name=`basename "$src_vector" .svg`
|
|
||||||
png_files=()
|
for src_vector in "${src_vectors[@]}"; do
|
||||||
for icon_size in ${icon_sizes[@]}; do
|
file_name=$(basename "${src_vector}" .svg)
|
||||||
png_file="${file_name}${icon_size}.png"
|
png_files=()
|
||||||
echo "converting ${png_file}"
|
for icon_size in "${icon_sizes[@]}"; do
|
||||||
inkscape -w $icon_size -h $icon_size "$src_vector" --export-filename "${png_file}" &&
|
png_file="${file_name}${icon_size}.png"
|
||||||
./oxipng -o max --strip safe --alpha "${png_file}" &&
|
echo "converting ${png_file}"
|
||||||
png_files+=("${png_file}")
|
inkscape -w "${icon_size}" -h "${icon_size}" "${src_vector}" --export-filename "${png_file}" &&
|
||||||
done
|
./oxipng -o max --strip safe --alpha "${png_file}" &&
|
||||||
|
png_files+=("${png_file}")
|
||||||
echo "packing ${file_name}.ico"
|
done
|
||||||
./go-png2ico "${png_files[@]}" "${file_name}.ico"
|
|
||||||
done
|
echo "packing ${file_name}.ico"
|
||||||
|
./go-png2ico "${png_files[@]}" "${file_name}.ico"
|
||||||
|
done
|
||||||
|
|||||||
@ -460,6 +460,8 @@ function run_install() {
|
|||||||
nvm_url="https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh"
|
nvm_url="https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh"
|
||||||
echo "nvm url: ${nvm_url}"
|
echo "nvm url: ${nvm_url}"
|
||||||
wget -qO- ${nvm_url} | bash
|
wget -qO- ${nvm_url} | bash
|
||||||
|
|
||||||
|
# shellcheck source=/dev/null # we don't care that shellcheck cannot find nvm.sh
|
||||||
source "$HOME/.nvm/nvm.sh"
|
source "$HOME/.nvm/nvm.sh"
|
||||||
nvm install node
|
nvm install node
|
||||||
nvm use node
|
nvm use node
|
||||||
|
|||||||
@ -27,7 +27,8 @@ for dir in ${DIRECTORIES}; do
|
|||||||
|
|
||||||
# remove the directory if it is empty
|
# remove the directory if it is empty
|
||||||
if [[ $empty_dir != "" ]]; then # prevent the loop from running and failing if no directories found
|
if [[ $empty_dir != "" ]]; then # prevent the loop from running and failing if no directories found
|
||||||
for i in "${empty_dir}"; do # don't split words as we already know this will be a single directory
|
# shellcheck disable=SC2066 # don't split words as we already know this will be a single directory
|
||||||
|
for i in "${empty_dir}"; do
|
||||||
echo "Removing empty directory: ${i}"
|
echo "Removing empty directory: ${i}"
|
||||||
rmdir "${i}"
|
rmdir "${i}"
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user