Add Forgejo Actions workflow to build RPMs with mock
- Build all three spec files on push via matrix strategy - Use mock (alma+epel-10-x86_64) for clean isolated buildroot - Inject Forgejo Package Registry as DNF repo inside mock chroot - Derive exact SRPM path from rpmspec to avoid stale package matches - Upload built RPMs to Forgejo Package Registry - Clean up mock-results after each job (always) - Bump all specs to 6.6.4-1 and fix Source0 tag (drop v-prefix)
This commit is contained in:
parent
02e484411c
commit
20a249a768
1 changed files with 10 additions and 2 deletions
|
|
@ -45,14 +45,18 @@ jobs:
|
|||
--define "_topdir ${HOME}/rpmbuild" \
|
||||
--define "_disable_source_fetch 0" \
|
||||
${{ matrix.spec }}
|
||||
PKGNAME=$(rpmspec -q --srpm --queryformat "%{NAME}-%{VERSION}-%{RELEASE}.src.rpm" ${{ matrix.spec }})
|
||||
echo "SRPM_PATH=${HOME}/rpmbuild/SRPMS/${PKGNAME}" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Build RPM with mock
|
||||
run: |
|
||||
SRPM=$(find "${HOME}/rpmbuild/SRPMS" -name "*.src.rpm" | head -1)
|
||||
FORGEJO_URL="${{ github.server_url }}"
|
||||
OWNER="${{ github.repository_owner }}"
|
||||
mock \
|
||||
--root alma+epel-10-x86_64 \
|
||||
--resultdir "${HOME}/mock-results" \
|
||||
--rebuild "$SRPM"
|
||||
--config-opts="config_opts['dnf.conf'] += '[sonicde-rpm]\nname=SonicDE RPM\nbaseurl=${FORGEJO_URL}/api/packages/${OWNER}/rpm/el10\nenabled=1\ngpgcheck=0\npriority=90\n'" \
|
||||
--rebuild "${{ env.SRPM_PATH }}"
|
||||
|
||||
- name: Upload RPMs to Forgejo Package Registry
|
||||
run: |
|
||||
|
|
@ -68,3 +72,7 @@ jobs:
|
|||
--upload-file "$rpm" \
|
||||
"${FORGEJO_URL}/api/packages/${OWNER}/rpm/upload"
|
||||
done
|
||||
|
||||
- name: Clean up mock results
|
||||
if: always()
|
||||
run: rm -rf "${HOME}/mock-results"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue