Update workflow #101
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rebuild and Upload | |
on: | |
- push | |
- workflow_dispatch | |
jobs: | |
job: | |
runs-on: ubuntu-latest | |
container: fedora:${{ github.ref_name }} | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Install Dependencies | |
run: dnf install -y dnf-plugins-core patch rpm-build copr-cli | |
- name: Rebuild SRPM | |
run: | | |
dnf download --source $(find SPECS-PATCHES -name "*.patch" -exec basename {} .patch \; | xargs) && | |
rpm -ivh --define "_topdir ${GITHUB_WORKSPACE}" *.src.rpm && | |
for patch in SPECS-PATCHES/*.patch; do | |
pushd SPECS > /dev/null; | |
patch -p0 < "../$patch" || { echo "Patch $patch Failed!"; exit 1; } | |
popd > /dev/null; | |
done && | |
rpmbuild --define "_topdir ${GITHUB_WORKSPACE}" -bs SPECS/*.spec | |
- name: Upload Copr | |
run: | | |
echo "${{ secrets.COPR_API }}" > copr-api && | |
. /etc/os-release && | |
copr-cli --config copr-api build --nowait --chroot ${ID}-${VERSION_ID}-$(uname -m) $(echo ${{ github.repository }} | cut -d "-" -f 2-) SRPMS/*.src.rpm |