Skip to content

Commit

Permalink
Merge pull request #782 from jlebon/pr/copr
Browse files Browse the repository at this point in the history
  • Loading branch information
jlebon committed Feb 22, 2022
2 parents 91396e9 + 9a9c5c9 commit 4a03808
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .copr/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.PHONY: srpm
srpm:
dnf install -y git rust-packaging rpm-build rpmdevtools
curl -LO https://src.fedoraproject.org/rpms/rust-coreos-installer/raw/rawhide/f/rust-coreos-installer.spec
version=$$(git describe --always --tags | sed -e 's,-,\.,g' -e 's,^v,,'); \
git archive --format=tar --prefix=coreos-installer-$$version/ HEAD | gzip > coreos-installer-$$version.crate; \
sed -ie "s,^Version:.*,Version: $$version," rust-coreos-installer.spec
sed -ie 's/^Patch/# Patch/g' rust-coreos-installer.spec # we don't want any downstream patches
sed -ie 's/^Source1/# Source1/g' rust-coreos-installer.spec # we don't vendor
spectool -g -s 2 rust-coreos-installer.spec # fetch coreos-installer-dracut just to satisfy rpmbuild
rpmbuild -bs --define "_sourcedir ${PWD}" --define "_specdir ${PWD}" --define "_builddir ${PWD}" --define "_srcrpmdir ${PWD}" --define "_rpmdir ${PWD}" --define "_buildrootdir ${PWD}/.build" rust-coreos-installer.spec
mv *.src.rpm $$outdir
34 changes: 34 additions & 0 deletions .github/workflows/rpm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: RPM build
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read

jobs:
test-rpm-build:
name: "RPM build"
runs-on: ubuntu-latest
container:
image: registry.fedoraproject.org/fedora:latest
options: --privileged
steps:
# need to install git before checkout to get a git repo
- name: Install packages
run: dnf install -y git make mock
- name: Checkout repository
uses: actions/checkout@v2
- name: Build RPM
run: |
mkdir rpms
make -f .copr/Makefile srpm outdir=rpms
mock --rebuild rpms/*.src.rpm
find /var/lib/mock -wholename '*/result/*.rpm' | xargs mv -t rpms
- name: Archive RPMs
uses: actions/upload-artifact@v2
with:
name: rpms
path: rpms/

0 comments on commit 4a03808

Please sign in to comment.