use mock instead

This commit is contained in:
Anders da Silva Rytter Hansen 2026-05-27 12:19:07 -03:00
commit f7e5b1e324

View file

@ -26,33 +26,41 @@ jobs:
dnf install -y \ dnf install -y \
rpm-build \ rpm-build \
rpmdevtools \ rpmdevtools \
dnf-plugins-core \ mock \
curl curl
- name: Add runner user to mock group
run: usermod -aG mock $(whoami) || true
- name: Setup RPM build tree - name: Setup RPM build tree
run: rpmdev-setuptree run: rpmdev-setuptree
- name: Install build dependencies for ${{ matrix.spec }}
run: |
dnf builddep -y ${{ matrix.spec }}
- name: Download sources for ${{ matrix.spec }} - name: Download sources for ${{ matrix.spec }}
run: | run: |
spectool -g -R ${{ matrix.spec }} spectool -g -C ~/rpmbuild/SOURCES/ ${{ matrix.spec }}
- name: Build RPM from ${{ matrix.spec }} - name: Build SRPM from ${{ matrix.spec }}
run: | run: |
rpmbuild -ba \ rpmbuild -bs \
--define "_topdir ${HOME}/rpmbuild" \ --define "_topdir ${HOME}/rpmbuild" \
--define "_disable_source_fetch 0" \
${{ matrix.spec }} ${{ matrix.spec }}
- name: Build RPM with mock
run: |
SRPM=$(find "${HOME}/rpmbuild/SRPMS" -name "*.src.rpm" | head -1)
mock \
--root almalinux-10-x86_64 \
--resultdir "${HOME}/mock-results" \
--rebuild "$SRPM"
- name: Upload RPMs to Forgejo Package Registry - name: Upload RPMs to Forgejo Package Registry
run: | run: |
FORGEJO_URL="${{ env.GITHUB_SERVER_URL }}" FORGEJO_URL="${{ github.server_url }}"
OWNER="${{ github.repository_owner }}" OWNER="${{ github.repository_owner }}"
TOKEN="${{ secrets.PACKAGE_TOKEN }}" TOKEN="${{ secrets.PACKAGE_TOKEN }}"
find "${HOME}/rpmbuild/RPMS" -name "*.rpm" | while read rpm; do find "${HOME}/mock-results" -name "*.rpm" ! -name "*.src.rpm" | while read rpm; do
FILENAME=$(basename "$rpm") FILENAME=$(basename "$rpm")
echo "Uploading $FILENAME ..." echo "Uploading $FILENAME ..."
curl --fail-with-body \ curl --fail-with-body \