build(linux): sync PKGBUILD with pacman-repo (#2833)
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
# This action is a candidate to centrally manage in https://github.com/<organization>/.github/
|
# This action is a candidate to centrally manage in https://github.com/<organization>/.github/
|
||||||
# If more Homebrew applications are developed, consider moving this action to the organization's .github repository,
|
# If more Homebrew applications are developed, consider moving this action to the organization's .github repository,
|
||||||
# using the `homebrew-pkg` repository label to identify repositories that should trigger have this workflow.
|
# using the `homebrew-pkg` repository label to identify repositories that should trigger this workflow.
|
||||||
|
|
||||||
# Update Homebrew on release events.
|
# Update Homebrew on release events.
|
||||||
|
|
||||||
|
|||||||
110
.github/workflows/update-pacman-repo.yml
vendored
Normal file
110
.github/workflows/update-pacman-repo.yml
vendored
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
---
|
||||||
|
# This action is a candidate to centrally manage in https://github.com/<organization>/.github/
|
||||||
|
# If more pacman packages are developed, consider moving this action to the organization's .github repository,
|
||||||
|
# using the `pacman-pkg` repository label to identify repositories that should trigger have this workflow.
|
||||||
|
|
||||||
|
# Update pacman repo on release events.
|
||||||
|
|
||||||
|
name: Update pacman repo
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [created, edited]
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: "${{ github.workflow }}-${{ github.event.release.tag_name }}"
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update-homebrew-release:
|
||||||
|
if: >-
|
||||||
|
github.repository_owner == 'LizardByte' &&
|
||||||
|
!github.event.release.draft && !github.event.release.prerelease
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check if pacman repo
|
||||||
|
env:
|
||||||
|
TOPIC: pacman-pkg
|
||||||
|
id: check
|
||||||
|
uses: actions/github-script@v7
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const topic = process.env.TOPIC;
|
||||||
|
console.log(`Checking if repo has topic: ${topic}`);
|
||||||
|
|
||||||
|
const repoTopics = await github.rest.repos.getAllTopics({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo
|
||||||
|
});
|
||||||
|
console.log(`Repo topics: ${repoTopics.data.names}`);
|
||||||
|
|
||||||
|
const hasTopic = repoTopics.data.names.includes(topic);
|
||||||
|
console.log(`Has topic: ${hasTopic}`);
|
||||||
|
|
||||||
|
core.setOutput('hasTopic', hasTopic);
|
||||||
|
|
||||||
|
- name: Check if edited release is latest GitHub release
|
||||||
|
id: check
|
||||||
|
if: >-
|
||||||
|
github.event_name == 'release' &&
|
||||||
|
github.event.action == 'edited'
|
||||||
|
uses: actions/github-script@v7
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const latestRelease = await github.rest.repos.getLatestRelease({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo
|
||||||
|
});
|
||||||
|
|
||||||
|
core.setOutput('isLatestRelease', latestRelease.data.tag_name === context.payload.release.tag_name);
|
||||||
|
|
||||||
|
- name: Checkout pacman-repo
|
||||||
|
if: >-
|
||||||
|
steps.check.outputs.hasTopic == 'true' &&
|
||||||
|
steps.check.outputs.isLatestRelease == 'true'
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: ${{ github.repository_owner }}/pacman-repo
|
||||||
|
|
||||||
|
- name: Prep
|
||||||
|
id: prep
|
||||||
|
if: >-
|
||||||
|
steps.check.outputs.hasTopic == 'true' &&
|
||||||
|
steps.check.outputs.isLatestRelease == 'true'
|
||||||
|
run: |
|
||||||
|
echo "pkg_name=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Download release asset
|
||||||
|
id: download
|
||||||
|
if: >-
|
||||||
|
steps.check.outputs.hasTopic == 'true' &&
|
||||||
|
steps.check.outputs.isLatestRelease == 'true'
|
||||||
|
uses: robinraju/release-downloader@v1.11
|
||||||
|
with:
|
||||||
|
repository: "${{ github.repository }}"
|
||||||
|
tag: "${{ github.event.release.tag_name }}"
|
||||||
|
fileName: "*.pkg.tar.gz"
|
||||||
|
tarBall: false
|
||||||
|
zipBall: false
|
||||||
|
out-file-path: "pkgbuilds/${{ steps.prep.outputs.pkg_name }}"
|
||||||
|
extract: true
|
||||||
|
|
||||||
|
- name: Create/Update Pull Request
|
||||||
|
if: >-
|
||||||
|
steps.check.outputs.hasTopic == 'true'&&
|
||||||
|
steps.check.outputs.isLatestRelease == 'true' &&
|
||||||
|
fromJson(steps.download.outputs.downloaded_files)[0]
|
||||||
|
uses: peter-evans/create-pull-request@v6
|
||||||
|
with:
|
||||||
|
add-paths: |
|
||||||
|
pkgbuilds/*
|
||||||
|
token: ${{ secrets.GH_BOT_TOKEN }}
|
||||||
|
commit-message: Update ${{ github.repository }} to ${{ github.event.release.tag_name }}
|
||||||
|
branch: bot/bump-${{ github.repository }}-${{ github.event.release.tag_name }}
|
||||||
|
delete-branch: true
|
||||||
|
base: master
|
||||||
|
title: Update ${{ github.repository }} to ${{ github.event.release.tag_name }}
|
||||||
|
body: ${{ github.event.release.body }}
|
||||||
|
labels: |
|
||||||
|
auto-approve
|
||||||
|
auto-merge
|
||||||
2
.github/workflows/update-winget-release.yml
vendored
2
.github/workflows/update-winget-release.yml
vendored
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
# This action is a candidate to centrally manage in https://github.com/<organization>/.github/
|
# This action is a candidate to centrally manage in https://github.com/<organization>/.github/
|
||||||
# If more Winget applications are developed, consider moving this action to the organization's .github repository,
|
# If more Winget applications are developed, consider moving this action to the organization's .github repository,
|
||||||
# using the `winget-pkg` repository label to identify repositories that should trigger have this workflow.
|
# using the `winget-pkg` repository label to identify repositories that should trigger this workflow.
|
||||||
|
|
||||||
# Update Winget on release events.
|
# Update Winget on release events.
|
||||||
|
|
||||||
|
|||||||
@@ -7,10 +7,15 @@ ARG BASE=archlinux/archlinux
|
|||||||
ARG TAG=base-devel
|
ARG TAG=base-devel
|
||||||
FROM ${BASE}:${TAG} AS sunshine-base
|
FROM ${BASE}:${TAG} AS sunshine-base
|
||||||
|
|
||||||
# Setup builder user, arch prevents running makepkg as root
|
# Update keyring to avoid signature errors, and update system
|
||||||
RUN useradd -m builder && \
|
RUN <<_DEPS
|
||||||
echo 'builder ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
|
#!/bin/bash
|
||||||
# makepkg is used in sunshine-build and uploader build stages
|
set -e
|
||||||
|
pacman -Syy --disable-download-timeout --needed --noconfirm \
|
||||||
|
archlinux-keyring
|
||||||
|
pacman -Syu --disable-download-timeout --noconfirm
|
||||||
|
pacman -Scc --noconfirm
|
||||||
|
_DEPS
|
||||||
|
|
||||||
FROM sunshine-base as sunshine-build
|
FROM sunshine-base as sunshine-build
|
||||||
|
|
||||||
@@ -25,13 +30,20 @@ ENV BUILD_VERSION=${BUILD_VERSION}
|
|||||||
ENV COMMIT=${COMMIT}
|
ENV COMMIT=${COMMIT}
|
||||||
|
|
||||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||||
|
|
||||||
|
# Setup builder user, arch prevents running makepkg as root
|
||||||
|
RUN useradd -m builder && \
|
||||||
|
echo 'builder ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
|
||||||
|
|
||||||
|
# patch the build flags
|
||||||
|
# hadolint ignore=SC2016
|
||||||
|
RUN sed -i 's,#MAKEFLAGS="-j2",MAKEFLAGS="-j$(nproc)",g' /etc/makepkg.conf
|
||||||
|
|
||||||
# install dependencies
|
# install dependencies
|
||||||
# cuda is an optional build-time dependency for PKGBUILD
|
|
||||||
RUN <<_DEPS
|
RUN <<_DEPS
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
pacman -Syu --disable-download-timeout --needed --noconfirm \
|
pacman -Syu --disable-download-timeout --needed --noconfirm \
|
||||||
archlinux-keyring \
|
|
||||||
base-devel \
|
base-devel \
|
||||||
cmake \
|
cmake \
|
||||||
cuda \
|
cuda \
|
||||||
@@ -89,6 +101,8 @@ USER builder
|
|||||||
RUN <<_PKGBUILD
|
RUN <<_PKGBUILD
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
# shellcheck source=/dev/null
|
||||||
|
source /etc/profile # ensure cuda is in the PATH
|
||||||
export DISPLAY=:1
|
export DISPLAY=:1
|
||||||
Xvfb ${DISPLAY} -screen 0 1024x768x24 &
|
Xvfb ${DISPLAY} -screen 0 1024x768x24 &
|
||||||
namcap -i PKGBUILD
|
namcap -i PKGBUILD
|
||||||
@@ -104,16 +118,12 @@ COPY --link --from=sunshine-build /build/sunshine/sunshine.pkg.tar.gz /sunshine.
|
|||||||
|
|
||||||
FROM sunshine-base as sunshine
|
FROM sunshine-base as sunshine
|
||||||
|
|
||||||
# copy from uploader instead of artifacts or uploader stage will not run
|
|
||||||
COPY --link --from=artifacts /sunshine.pkg.tar.zst /
|
COPY --link --from=artifacts /sunshine.pkg.tar.zst /
|
||||||
|
|
||||||
# install sunshine
|
# install sunshine
|
||||||
RUN <<_INSTALL_SUNSHINE
|
RUN <<_INSTALL_SUNSHINE
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
# update keyring to prevent cached keyring errors
|
|
||||||
pacman -Syu --disable-download-timeout --needed --noconfirm \
|
|
||||||
archlinux-keyring
|
|
||||||
pacman -U --disable-download-timeout --needed --noconfirm \
|
pacman -U --disable-download-timeout --needed --noconfirm \
|
||||||
/sunshine.pkg.tar.zst
|
/sunshine.pkg.tar.zst
|
||||||
pacman -Scc --noconfirm
|
pacman -Scc --noconfirm
|
||||||
@@ -139,10 +149,6 @@ ENV HOME=/home/$UNAME
|
|||||||
RUN <<_SETUP_USER
|
RUN <<_SETUP_USER
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
# first delete the builder user
|
|
||||||
userdel -r builder
|
|
||||||
|
|
||||||
# then create the lizard user
|
|
||||||
groupadd -f -g "${PGID}" "${UNAME}"
|
groupadd -f -g "${PGID}" "${UNAME}"
|
||||||
useradd -lm -d ${HOME} -s /bin/bash -g "${PGID}" -u "${PUID}" "${UNAME}"
|
useradd -lm -d ${HOME} -s /bin/bash -g "${PGID}" -u "${PUID}" "${UNAME}"
|
||||||
mkdir -p ${HOME}/.config/sunshine
|
mkdir -p ${HOME}/.config/sunshine
|
||||||
|
|||||||
@@ -12,41 +12,51 @@ install=sunshine.install
|
|||||||
|
|
||||||
_gcc_version=13
|
_gcc_version=13
|
||||||
|
|
||||||
depends=('avahi'
|
depends=(
|
||||||
'curl'
|
'avahi'
|
||||||
'libayatana-appindicator'
|
'curl'
|
||||||
'libcap'
|
'libayatana-appindicator'
|
||||||
'libdrm'
|
'libcap'
|
||||||
'libevdev'
|
'libdrm'
|
||||||
'libmfx'
|
'libevdev'
|
||||||
'libnotify'
|
'libmfx'
|
||||||
'libpulse'
|
'libnotify'
|
||||||
'libva'
|
'libpulse'
|
||||||
'libvdpau'
|
'libva'
|
||||||
'libx11'
|
'libvdpau'
|
||||||
'libxcb'
|
'libx11'
|
||||||
'libxfixes'
|
'libxcb'
|
||||||
'libxrandr'
|
'libxfixes'
|
||||||
'libxtst'
|
'libxrandr'
|
||||||
'miniupnpc'
|
'libxtst'
|
||||||
'numactl'
|
'miniupnpc'
|
||||||
'openssl'
|
'numactl'
|
||||||
'opus'
|
'openssl'
|
||||||
'udev')
|
'opus'
|
||||||
makedepends=('cmake'
|
'udev'
|
||||||
'doxygen'
|
)
|
||||||
"gcc${_gcc_version}"
|
|
||||||
'graphviz'
|
|
||||||
'git'
|
|
||||||
'make'
|
|
||||||
'nodejs'
|
|
||||||
'npm'
|
|
||||||
'python')
|
|
||||||
optdepends=('cuda: Nvidia GPU encoding support'
|
|
||||||
'libva-mesa-driver: AMD GPU encoding support'
|
|
||||||
'xorg-server-xvfb: Virtual X server for headless testing')
|
|
||||||
|
|
||||||
provides=('sunshine')
|
makedepends=(
|
||||||
|
'cmake'
|
||||||
|
'cuda'
|
||||||
|
'doxygen'
|
||||||
|
"gcc${_gcc_version}"
|
||||||
|
'graphviz'
|
||||||
|
'git'
|
||||||
|
'make'
|
||||||
|
'nodejs'
|
||||||
|
'npm'
|
||||||
|
'python'
|
||||||
|
)
|
||||||
|
|
||||||
|
optdepends=(
|
||||||
|
'cuda: Nvidia GPU encoding support'
|
||||||
|
'libva-mesa-driver: AMD GPU encoding support'
|
||||||
|
'xorg-server-xvfb: Virtual X server for headless testing'
|
||||||
|
)
|
||||||
|
|
||||||
|
provides=()
|
||||||
|
conflicts=()
|
||||||
|
|
||||||
source=("$pkgname::git+@GITHUB_CLONE_URL@#commit=@GITHUB_COMMIT@")
|
source=("$pkgname::git+@GITHUB_CLONE_URL@#commit=@GITHUB_COMMIT@")
|
||||||
sha256sums=('SKIP')
|
sha256sums=('SKIP')
|
||||||
|
|||||||
Reference in New Issue
Block a user