From 9be806d4f253730991bef045ef1daff20bd8d063 Mon Sep 17 00:00:00 2001 From: David Auer Date: Fri, 27 Jan 2023 13:00:59 +0100 Subject: [PATCH] Build Fedora RPM in ci --- .github/workflows/build.yml | 38 +++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b45fcab..f9cd4d8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -58,13 +58,31 @@ jobs: - name: Validate desktop file run: desktop-file-validate freedesktop/com.github.cntools.cnping.desktop -# Build-RPM-for-Fedora: -# runs-on: ubuntu-latest -# container: dreua/ ... -# steps: -# - name: RPM Build -# run: /cnping/cnping-build -# - uses: actions/upload-artifact@v3 -# with: -# name: cnping-fedora-rpm -# path: /github/home/rpmbuild/**/*.rpm + Build-RPM-for-Fedora: + runs-on: ubuntu-latest + container: fedora:latest + steps: + # No checkout needed + - name: Install dependencies + run: | + sudo dnf install -y \ + rpm-build rpmdevtools \ + gcc \ + make \ + libXinerama-devel \ + libXext-devel \ + libX11-devel \ + libappstream-glib \ + desktop-file-utils + - name: Prepare build environment + run: | + curl -o cnping.spec -L https://raw.githubusercontent.com/dreua/cnping-rpmspec/nightly/cnping.spec + mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} + - name: Download source as described in spec + run: spectool --get-files --sourcedir cnping.spec + - name: Build RPM + run: rpmbuild -ba cnping.spec + - uses: actions/upload-artifact@v3 + with: + name: cnping-fedora-rpm + path: /github/home/rpmbuild/**/*.rpm