-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrpm.yml
More file actions
46 lines (39 loc) · 1.4 KB
/
Copy pathrpm.yml
File metadata and controls
46 lines (39 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Build RPM
on:
push:
tags: ['v*'] # build on version tags like v1.0.0
workflow_dispatch: {} # and on a manual button press
permissions:
contents: write # needed to attach files to the Release
jobs:
rpm:
runs-on: ubuntu-latest
container: fedora:latest
steps:
- name: Install build tooling
run: |
dnf -y install rpm-build rpmdevtools git \
desktop-file-utils libappstream-glib
- uses: actions/checkout@v4
- name: Build SRPM + RPM
run: |
rpmdev-setuptree
git config --global --add safe.directory "$PWD"
VERSION=$(rpmspec -q --qf '%{version}\n' per-device-eq.spec | head -1)
# produce a tarball whose layout matches Source0 / %autosetup
git archive --format=tar.gz \
--prefix="calibrate-room-rew-${VERSION}/" \
-o ~/rpmbuild/SOURCES/calibrate-room-rew-${VERSION}.tar.gz HEAD
rpmbuild -ba per-device-eq.spec
mkdir -p out
cp ~/rpmbuild/RPMS/noarch/*.rpm ~/rpmbuild/SRPMS/*.src.rpm out/
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: rpms
path: out/*.rpm
- name: Attach RPMs to the GitHub Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: out/*.rpm