mirror of
https://github.com/LizardByte/Sunshine.git
synced 2025-02-06 09:39:50 +00:00
ci(copr): use copr-ci workflow (#3276)
Some checks failed
CI / GitHub Env Debug (push) Has been cancelled
CI / Setup Release (push) Has been cancelled
CI / Setup Flatpak Matrix (push) Has been cancelled
CI Docker / Check Dockerfiles (push) Has been cancelled
CodeQL / Get language matrix (push) Has been cancelled
Build GH-Pages / update_pages (push) Has been cancelled
CI / Linux Flatpak (push) Has been cancelled
CI / Linux ${{ matrix.type }} (--appimage-build, 22.04, AppImage) (push) Has been cancelled
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (macos, 13) (push) Has been cancelled
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (macos, 14) (push) Has been cancelled
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (ubuntu, latest) (push) Has been cancelled
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (ubuntu, latest, true) (push) Has been cancelled
CI / Macports (macOS-${{ matrix.os_version }}) (13, true) (push) Has been cancelled
CI / Macports (macOS-${{ matrix.os_version }}) (14) (push) Has been cancelled
CI / Windows (push) Has been cancelled
CI Docker / Setup Release (push) Has been cancelled
CI Docker / Docker${{ matrix.tag }} (push) Has been cancelled
CodeQL / Analyze (${{ matrix.name }}) (push) Has been cancelled
Some checks failed
CI / GitHub Env Debug (push) Has been cancelled
CI / Setup Release (push) Has been cancelled
CI / Setup Flatpak Matrix (push) Has been cancelled
CI Docker / Check Dockerfiles (push) Has been cancelled
CodeQL / Get language matrix (push) Has been cancelled
Build GH-Pages / update_pages (push) Has been cancelled
CI / Linux Flatpak (push) Has been cancelled
CI / Linux ${{ matrix.type }} (--appimage-build, 22.04, AppImage) (push) Has been cancelled
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (macos, 13) (push) Has been cancelled
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (macos, 14) (push) Has been cancelled
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (ubuntu, latest) (push) Has been cancelled
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (ubuntu, latest, true) (push) Has been cancelled
CI / Macports (macOS-${{ matrix.os_version }}) (13, true) (push) Has been cancelled
CI / Macports (macOS-${{ matrix.os_version }}) (14) (push) Has been cancelled
CI / Windows (push) Has been cancelled
CI Docker / Setup Release (push) Has been cancelled
CI Docker / Docker${{ matrix.tag }} (push) Has been cancelled
CodeQL / Analyze (${{ matrix.name }}) (push) Has been cancelled
This commit is contained in:
parent
d3ad63654a
commit
d378c18a81
52
.github/workflows/ci-copr.yml
vendored
52
.github/workflows/ci-copr.yml
vendored
@ -13,49 +13,21 @@ on:
|
||||
types:
|
||||
- prereleased
|
||||
- released
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: "${{ github.workflow }}-${{ github.ref }}"
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Copr build
|
||||
if: github.repository_owner == 'LizardByte'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Get properties
|
||||
env:
|
||||
COPR_PR_WH_KEY: "05fc9b07-a19b-4f83-89b2-ae1e7e0b5282"
|
||||
run: |
|
||||
# package name = repository name
|
||||
package=${{ github.event.repository.name }}
|
||||
copr_base="https://copr.fedorainfracloud.org/webhooks/custom-dir/lizardbyte"
|
||||
|
||||
# release and released type
|
||||
if [ "${{ github.event_name }}" = "release" ]; then
|
||||
if [ "${{ github.event.action }}" = "prereleased" ]; then
|
||||
COPR_PUSH_WEBHOOK="${copr_base}/beta/${{ secrets.COPR_BETA_WEBHOOK_TOKEN }}/${package}/"
|
||||
elif [ "${{ github.event.action }}" = "released" ]; then
|
||||
COPR_PUSH_WEBHOOK="${copr_base}/stable/${{ secrets.COPR_STABLE_WEBHOOK_TOKEN }}/${package}/"
|
||||
fi
|
||||
elif [ "${{ github.event_name }}" = "pull_request" ]; then
|
||||
COPR_PR_WEBHOOK="${copr_base}/pulls:pr:${{github.event.number}}/${{env.COPR_PR_WH_KEY}}/${package}/"
|
||||
fi
|
||||
|
||||
echo "COPR_PUSH_WEBHOOK=${COPR_PUSH_WEBHOOK}" >> $GITHUB_ENV
|
||||
echo "COPR_PR_WEBHOOK=${COPR_PR_WEBHOOK}" >> $GITHUB_ENV
|
||||
|
||||
echo "COPR_PUSH_WEBHOOK=${COPR_PUSH_WEBHOOK}"
|
||||
echo "COPR_PR_WEBHOOK=${COPR_PR_WEBHOOK}"
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
curl https://raw.githubusercontent.com/praiskup/copr-ci-tooling/main/copr-gh-actions-submit > submit
|
||||
|
||||
# if a PR number is added the script will use the PR webhook, otherwise it will use the push webhook
|
||||
bash submit ${{ github.event.pull_request.number }}
|
||||
call-copr-ci:
|
||||
uses: LizardByte/copr-ci/.github/workflows/copr-ci.yml@master
|
||||
with:
|
||||
copr_pr_webhook_token: "05fc9b07-a19b-4f83-89b2-ae1e7e0b5282"
|
||||
github_org_owner: LizardByte
|
||||
copr_ownername: lizardbyte
|
||||
auto_update_package: true
|
||||
job_timeout: 60
|
||||
secrets:
|
||||
COPR_BETA_WEBHOOK_TOKEN: ${{ secrets.COPR_BETA_WEBHOOK_TOKEN }}
|
||||
COPR_STABLE_WEBHOOK_TOKEN: ${{ secrets.COPR_STABLE_WEBHOOK_TOKEN }}
|
||||
COPR_CLI_CONFIG: ${{ secrets.COPR_CLI_CONFIG }}
|
||||
|
@ -9,8 +9,8 @@
|
||||
|
||||
Name: Sunshine
|
||||
Version: %{build_version}
|
||||
Summary: Self-hosted game stream host for Moonlight.
|
||||
Release: 1%{?dist}
|
||||
Summary: Self-hosted game stream host for Moonlight.
|
||||
License: GPLv3-only
|
||||
URL: https://github.com/LizardByte/Sunshine
|
||||
Source0: tarball.tar.gz
|
@ -1,62 +0,0 @@
|
||||
#! /bin/sh -x
|
||||
|
||||
# This file is not used directly in this repository. It should be uploaded to Copr whenever the file changes.
|
||||
# Replicate to each package in "pulls", "beta", and "stable" Copr repositories
|
||||
|
||||
set -e
|
||||
resultdir="${COPR_RESULTDIR}"
|
||||
git clone "https://github.com/${COPR_OWNER}/${COPR_PACKAGE}.git" --depth 1
|
||||
cd "${COPR_PACKAGE}"
|
||||
|
||||
# optional part; drop if building against 'master' is enough
|
||||
if test -z "$REVISION"; then
|
||||
# the hook_payload file contains webhook JSON payload (copr creates it for
|
||||
# us); it is created only if the build is triggered by Custom webhook.
|
||||
if test -f "$resultdir"/hook_payload; then
|
||||
git clone https://github.com/praiskup/copr-ci-tooling \
|
||||
"$resultdir/cct" --depth 1
|
||||
export PATH="$resultdir/cct:$PATH"
|
||||
|
||||
echo "---"
|
||||
cat "$resultdir"/hook_payload
|
||||
echo "---"
|
||||
|
||||
# use jq to get the pr_id from the hook_payload
|
||||
PR=$(jq -r '.pr_id' "$resultdir"/hook_payload)
|
||||
if [ -z "$PR" ]; then
|
||||
BRANCH="master"
|
||||
else
|
||||
BRANCH="pr/${PR}"
|
||||
fi
|
||||
|
||||
copr-travis-checkout "$resultdir"/hook_payload
|
||||
fi
|
||||
else
|
||||
git checkout "$REVISION"
|
||||
fi
|
||||
|
||||
# initialize the submodules
|
||||
git submodule update --init --recursive
|
||||
|
||||
# get the tag of this commit IF it has one
|
||||
TAG=$(git tag --points-at HEAD | head -n1)
|
||||
if [ -z "$TAG" ]; then
|
||||
TAG="0.0.$PR"
|
||||
fi
|
||||
TAG=$(echo "$TAG" | sed 's/^v//') # remove v prefix from the tag
|
||||
echo "TAG=$TAG"
|
||||
|
||||
# get the commit
|
||||
COMMIT=$(git rev-parse HEAD)
|
||||
echo "COMMIT=$COMMIT"
|
||||
|
||||
# move spec file to the correct location
|
||||
mv packaging/linux/fedora/*.spec "${resultdir}"
|
||||
|
||||
# use sed to replace these values in the spec file
|
||||
sed -i "s|%global build_version 0|%global build_version ${TAG}|" "${resultdir}"/*.spec
|
||||
sed -i "s|%global branch 0|%global branch ${BRANCH}|" "${resultdir}"/*.spec
|
||||
sed -i "s|%global commit 0|%global commit ${COMMIT}|" "${resultdir}"/*.spec
|
||||
|
||||
# create a tarball of the source code
|
||||
tar -czf "${resultdir}/tarball.tar.gz" .
|
Loading…
x
Reference in New Issue
Block a user