📦 Use new 'make rpm' in GitHub Actions

Signed-off-by: Major Hayden <major@redhat.com>
This commit is contained in:
Major Hayden 2020-03-05 13:19:16 -06:00 committed by Tom Gundersen
parent c5543562b8
commit 94912a8759

View file

@ -58,10 +58,7 @@ jobs:
python3 -m unittest -v test.test_osrelease
rpm_build:
name: "RPM build"
needs:
- pylint
- unit_tests
name: "📦 RPM"
runs-on: ubuntu-latest
strategy:
fail-fast: false
@ -70,57 +67,33 @@ jobs:
container:
image: "docker.io/library/fedora:${{ matrix.fedora_release }}"
steps:
- name: Prepare container
- name: "📥 Prepare container"
run: |
echo "fastestmirror=1" >> /etc/dnf/dnf.conf
echo "install_weak_deps=0" >> /etc/dnf/dnf.conf
rm -fv /etc/yum.repos.d/fedora*modular*
dnf -y upgrade
dnf -y install dnf-plugins-core rpm-build rpmdevtools
dnf -y install dnf-plugins-core findutils git make rpm-build rpmdevtools
- name: Fetch .spec file
- name: "🗄️ Clone the repository"
uses: actions/checkout@v2
- name: "🛒 Install RPM build dependencies"
run: dnf -y builddep osbuild.spec
- name: "🛠️ Build RPMs"
run: |
mkdir spec
# Fetch the spec file at the given commit, and prepend the commit sha to it
curl "https://raw.githubusercontent.com/osbuild/osbuild/${GITHUB_SHA}/osbuild.spec" -o osbuild.spec
echo "%global commit ${GITHUB_SHA}" | cat - osbuild.spec > spec/osbuild.spec
mkdir rpms
make srpm
cp -av rpmbuild/SRPMS/*.rpm rpms/
make rpm
cp -av rpmbuild/RPMS/*/*.rpm rpms/
- name: Install RPM build dependencies
run: dnf -y builddep spec/osbuild.spec
- name: Fetch sources
run: |
mkdir sources
spectool -g spec/osbuild.spec -C sources/
- name: Build SRPM
run: |
mkdir srpms
rpmbuild -bs \
--define "_sourcedir sources" \
--define "_srcrpmdir srpms" \
spec/osbuild.spec
- name: Build RPMs
run: |
mkdir rpmbuild rpms build
rpmbuild -bb \
--define "_sourcedir `pwd`/sources" \
--define "_specdir `pwd`/spec" \
--define "_builddir `pwd`/rpmbuild" \
--define "_srcrpmdir `pwd`/srpms" \
--define "_rpmdir `pwd`/rpms" \
--define "_buildrootdir `pwd`/build" \
spec/osbuild.spec
- name: "Upload artifacts"
- name: "📤 Upload artifacts"
uses: actions/upload-artifact@v1
with:
name: rpms
path: rpms/
- name: Test RPM installation
run: |
pushd rpms/noarch
dnf -y install $(ls *.rpm)
popd
- name: "🔎 Test RPM installation"
run: dnf -y install $(ls rpms/*.noarch.rpm)