build(fedora)!: add copr build (#3239)

This commit is contained in:
ReenigneArcher 2024-10-06 14:41:21 -04:00 committed by GitHub
commit 15b91a1ad4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 378 additions and 238 deletions

56
.github/workflows/ci-copr.yml vendored Normal file
View file

@ -0,0 +1,56 @@
---
name: CI Copr
on:
pull_request:
branches:
- master
types:
- opened
- synchronize
- reopened
release:
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
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}}/${{vars.COPR_PR_WEBHOOK_TOKEN}}/${package}/"
fi
echo "COPR_PUSH_WEBHOOK=${COPR_PUSH_WEBHOOK}" >> $GITHUB_ENV
echo "COPR_PR_WEBHOOK=${COPR_PR_WEBHOOK}" >> $GITHUB_ENV
- 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 }}

View file

@ -180,7 +180,7 @@ jobs:
with:
path: "flathub/${{ env.FLATHUB_PKG }}"
token: ${{ secrets.GH_BOT_TOKEN }}
commit-message: Update ${{ env.FLATHUB_PKG }} to ${{ github.event.release.tag_name }}
commit-message: "chore: Update ${{ env.FLATHUB_PKG }} to ${{ github.event.release.tag_name }}"
branch: bot/bump-${{ env.FLATHUB_PKG }}-${{ github.event.release.tag_name }}
delete-branch: true
title: "chore: Update ${{ env.FLATHUB_PKG }} to ${{ github.event.release.tag_name }}"

View file

@ -70,7 +70,7 @@ jobs:
steps.check-label.outputs.hasTopic == 'true' &&
steps.check-release.outputs.isLatestRelease == 'true'
run: |
echo "pkg_name=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
echo "pkg_name=$(echo ${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
- name: Download release asset
id: download
@ -97,7 +97,7 @@ jobs:
add-paths: |
pkgbuilds/*
token: ${{ secrets.GH_BOT_TOKEN }}
commit-message: Update ${{ github.repository }} to ${{ github.event.release.tag_name }}
commit-message: "chore: Update ${{ github.repository }} to ${{ github.event.release.tag_name }}"
branch: bot/bump-${{ github.repository }}-${{ github.event.release.tag_name }}
delete-branch: true
title: "chore: Update ${{ github.repository }} to ${{ github.event.release.tag_name }}"