Skip to content

Commit

Permalink
aur: move docker build (#895)
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher authored Feb 13, 2023
1 parent 0d100a5 commit 032680c
Show file tree
Hide file tree
Showing 14 changed files with 349 additions and 117 deletions.
103 changes: 0 additions & 103 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,109 +147,6 @@ jobs:
outputs:
matrix: ${{ steps.flatpak_matrix.outputs.matrix }}

build_linux_aur:
name: Linux AUR
runs-on: ubuntu-latest
needs: setup_release

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Dependencies Linux AUR
run: |
sudo apt-get update -y
sudo apt-get install -y \
cmake
- name: Configure PKGBUILD files
id: prepare
run: |
# variables for manifest
aur_publish=false
aur_pkg=sunshine-dev
sub_version=""
conflicts="'sunshine'"
provides="'sunshine'"
branch=${GITHUB_HEAD_REF}
# check the branch variable
if [ -z "$branch" ]; then
echo "This is a PUSH event"
commit=${{ github.sha }}
clone_url=${{ github.event.repository.clone_url }}
if [[ ${{ github.ref == 'refs/heads/master' }} == true ]]; then
echo "This is a main release event"
aur_publish=true
aur_pkg=sunshine
conflicts=""
provides=""
elif [[ ${{ github.ref == 'refs/heads/nightly' }} == true ]]; then
echo "This is a nightly release event"
sub_version=".r${commit}"
fi
else
echo "This is a PR event"
commit=${{ github.event.pull_request.head.sha }}
clone_url=${{ github.event.pull_request.head.repo.clone_url }}
sub_version=".r${commit}"
fi
echo "Commit: ${commit}"
echo "Clone URL: ${clone_url}"
echo "aur_publish=${aur_publish}" >> $GITHUB_OUTPUT
echo "aur_pkg=${aur_pkg}" >> $GITHUB_OUTPUT
mkdir -p artifacts
mkdir -p build
cd build
cmake -DSUNSHINE_CONFIGURE_AUR=ON \
-DSUNSHINE_AUR_PKG=${aur_pkg} \
-DSUNSHINE_SUB_VERSION=${sub_version} \
-DSUNSHINE_AUR_CONFLICTS=${conflicts} \
-DSUNSHINE_AUR_PROVIDES=${provides} \
-DGITHUB_CLONE_URL=${clone_url} \
-DGITHUB_COMMIT=${commit} \
-DSUNSHINE_CONFIGURE_ONLY=ON \
..
cd ..
mv ./build/PKGBUILD ./artifacts/
- name: Validate package
uses: LizardByte/archlinux-package-action@master
with:
path: artifacts
flags: '--syncdeps --noconfirm'
namcap: true
srcinfo: true
aur: true # workaround mirror problem

- name: Upload Artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: sunshine-linux-aur
path: artifacts/

- name: Publish AUR package
if: ${{ steps.prepare.outputs.aur_publish == 'true' }}
uses: KSXGitHub/[email protected]
with:
pkgname: ${{ steps.prepare.outputs.aur_pkg }}
pkgbuild: ./artifacts/PKGBUILD
assets: |
./artifacts/*
commit_username: ${{ secrets.AUR_USERNAME }}
commit_email: ${{ secrets.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: Automatic update from GitHub ${{ github.repository }} per ${{ github.ref }}
allow_empty_commits: false

build_linux_flatpak:
name: Linux Flatpak
runs-on: ubuntu-22.04
Expand Down
22 changes: 21 additions & 1 deletion .github/workflows/ci-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,20 @@ jobs:
# get branch name
BRANCH=${GITHUB_HEAD_REF}
RELEASE=false
if [ -z "$BRANCH" ]; then
echo "This is a PUSH event"
BRANCH=${{ github.ref_name }}
COMMIT=${{ github.sha }}
CLONE_URL=${{ github.event.repository.clone_url }}
if [[ $BRANCH == "master" ]]; then
RELEASE=true
fi
else
echo "This is a PULL REQUEST event"
COMMIT=${{ github.event.pull_request.head.sha }}
CLONE_URL=${{ github.event.pull_request.head.repo.clone_url }}
fi
# determine to push image to dockerhub and ghcr or not
Expand All @@ -220,7 +231,6 @@ jobs:
# setup the tags
REPOSITORY=${{ github.repository }}
BASE_TAG=$(echo $REPOSITORY | tr '[:upper:]' '[:lower:]')
COMMIT=${{ github.sha }}
TAGS="${BASE_TAG}:${COMMIT:0:7}${{ matrix.tag }},ghcr.io/${BASE_TAG}:${COMMIT:0:7}${{ matrix.tag }}"
Expand Down Expand Up @@ -277,6 +287,8 @@ jobs:
echo "branch=${BRANCH}" >> $GITHUB_OUTPUT
echo "build_date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
echo "commit=${COMMIT}" >> $GITHUB_OUTPUT
echo "clone_url=${CLONE_URL}" >> $GITHUB_OUTPUT
echo "release=${RELEASE}" >> $GITHUB_OUTPUT
echo "artifacts=${ARTIFACTS}" >> $GITHUB_OUTPUT
echo "platforms=${PLATFORMS}" >> $GITHUB_OUTPUT
echo "push=${PUSH}" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -328,6 +340,8 @@ jobs:
BUILD_DATE=${{ steps.prepare.outputs.build_date }}
BUILD_VERSION=${{ needs.check_changelog.outputs.next_version }}
COMMIT=${{ steps.prepare.outputs.commit }}
CLONE_URL=${{ steps.prepare.outputs.clone_url }}
RELEASE=${{ steps.prepare.outputs.release }}
tags: ${{ steps.prepare.outputs.tags }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
Expand All @@ -345,6 +359,12 @@ jobs:
BUILD_DATE=${{ steps.prepare.outputs.build_date }}
BUILD_VERSION=${{ needs.check_changelog.outputs.next_version }}
COMMIT=${{ steps.prepare.outputs.commit }}
CLONE_URL=${{ steps.prepare.outputs.clone_url }}
RELEASE=${{ steps.prepare.outputs.release }}
secrets: |
"AUR_EMAIL=${{ secrets.AUR_EMAIL }}"
"AUR_SSH_PRIVATE_KEY=${{ secrets.AUR_SSH_PRIVATE_KEY }}"
"AUR_USERNAME=${{ secrets.AUR_USERNAME }}"
tags: ${{ steps.prepare.outputs.tags }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [0.18.3] - 2023-02-13
### Added
- (Linux) Added PKGBUILD for Archlinux based distros to releases
- (Linux) Added precompiled package for Archlinux based distros to releases
- (Docker) Added archlinux docker image (x86_64 only)

## [0.18.2] - 2023-02-13
### Fixed
- (Video/KMV/Linux) Fixed wayland capture on Nvidia for KMS
Expand Down Expand Up @@ -317,3 +323,4 @@ settings. In v0.17.0, games now run under your user account without elevated pri
[0.18.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.18.0
[0.18.1]: https://github.com/LizardByte/Sunshine/releases/tag/v0.18.1
[0.18.2]: https://github.com/LizardByte/Sunshine/releases/tag/v0.18.2
[0.18.3]: https://github.com/LizardByte/Sunshine/releases/tag/v0.18.3
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.18)
# `CMAKE_CUDA_ARCHITECTURES` requires 3.18

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

Expand Down
17 changes: 11 additions & 6 deletions DOCKER_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ ENTRYPOINT steam && sunshine
- commit hash

### SUNSHINE_OS
Sunshine images are available, based on the following base images.
Sunshine images are available with the following tag suffixes, based on their respective base images.

- `archlinux`
- `debian-bullseye`
- `fedora-36`
- `fedora-37`
Expand Down Expand Up @@ -126,9 +127,13 @@ If you want to change the PUID or PGID after the image has been built, it will r
Specifying `lizardbyte/sunshine:latest-<SUNSHINE_OS>` or `ghcr.io/lizardbyte/sunshine:latest-<SUNSHINE_OS>` should
retrieve the correct image for your architecture.

The architectures supported by these images are:
The architectures supported by these images are shown in the table below.

| Architecture | Available |
|:---------------:|:---------:|
| amd64 / x86_64 | ✅ |
| arm64 / aarch64 | ✅ |
| tag suffix | amd64/x86_64 | arm64/aarch64 |
|-----------------|--------------|---------------|
| archlinux | ✅ | ❌ |
| debian-bullseye | ✅ | ✅ |
| fedora-36 | ✅ | ✅ |
| fedora-37 | ✅ | ✅ |
| ubuntu-20.04 | ✅ | ✅ |
| ubuntu-22.04 | ✅ | ✅ |
Loading

0 comments on commit 032680c

Please sign in to comment.