Skip to content

Commit 674e330

Browse files
Copilotalvarolopez
andcommitted
build: Replace buggy rpmbuild action with direct Docker-based build
Co-authored-by: alvarolopez <[email protected]>
1 parent 2bc2c82 commit 674e330

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

.github/workflows/packaging.yml

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,33 @@ jobs:
156156

157157
- name: Build RPM package
158158
id: rpm
159-
uses: alvarolopez/rpmbuild@rockylinux9
160-
with:
161-
source_file: dist/caso-${{ env.VERSION }}.tar.gz
162-
spec_file: "packaging/redhat/caso.spec"
159+
run: |
160+
# Create RPM build environment in Docker
161+
docker run --rm \
162+
-v $PWD:/workspace \
163+
-w /workspace \
164+
rockylinux:9 \
165+
bash -c "
166+
# Install build dependencies
167+
dnf install -y rpm-build rpmdevtools python3-devel python3-setuptools python3-pbr python3-rpm-macros pyproject-rpm-macros
168+
169+
# Set up RPM build tree
170+
rpmdev-setuptree
171+
172+
# Copy spec file and source
173+
cp packaging/redhat/caso.spec ~/rpmbuild/SPECS/
174+
cp dist/caso-${{ env.VERSION }}.tar.gz ~/rpmbuild/SOURCES/
175+
176+
# Build RPM
177+
rpmbuild -ba --define 'version ${{ env.VERSION }}' ~/rpmbuild/SPECS/caso.spec
178+
179+
# Copy built RPMs to workspace
180+
mkdir -p /workspace/rpmbuild/RPMS
181+
mkdir -p /workspace/rpmbuild/SRPMS
182+
cp -r ~/rpmbuild/RPMS/* /workspace/rpmbuild/RPMS/ || true
183+
cp ~/rpmbuild/SRPMS/*.rpm /workspace/rpmbuild/SRPMS/ || true
184+
"
185+
echo "rpm_dir_path=$PWD/rpmbuild" >> $GITHUB_OUTPUT
163186
164187
- name: Update RPM artifacts to release
165188
if: github.event_name == 'release'

0 commit comments

Comments
 (0)