-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #782 from jlebon/pr/copr
- Loading branch information
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |