Skip to content

Commit cc47bd9

Browse files
authored
Trigger COPR from GHA (#72)
This PR is adding a CI pipeline that will trigger COPR to build both the cmonitor_collector and cmonitor_tools RPMs and report back into Github the green/red status
1 parent f966cc9 commit cc47bd9

File tree

2 files changed

+66
-0
lines changed

2 files changed

+66
-0
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: trigger COPR
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
# add a cron job to run every month -- this project is not very active, at least ensure there's a valid CI build every month
9+
# this is also useful to check if something breaks e.g. due to infrastructure changes (e.g. Ubuntu OS)
10+
schedule:
11+
- cron: '0 0 1 * *'
12+
workflow_dispatch:
13+
14+
jobs:
15+
copr_build_collector:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
# install deps
20+
- name: install COPR CLI
21+
run: pip3 install copr-cli
22+
23+
- name: Setup Copr config file
24+
env:
25+
# You need to have those secrets in your repo.
26+
# See also: https://copr.fedorainfracloud.org/api/.
27+
COPR_CONFIG: ${{ secrets.COPR_CONFIG }}
28+
run: |
29+
mkdir -p ~/.config
30+
echo "$COPR_CONFIG" > ~/.config/copr
31+
32+
- name: Trigger COPR build [collector]
33+
run: |
34+
copr-cli buildscm \
35+
--type git --clone-url https://github.com/f18m/cmonitor.git \
36+
--subdir collector --method make_srpm --commit ${{ github.head_ref || github.ref_name }} \
37+
cmonitor
38+
39+
copr_build_tools:
40+
runs-on: ubuntu-latest
41+
42+
steps:
43+
# install deps
44+
- name: install COPR CLI
45+
run: pip3 install copr-cli
46+
47+
- name: Setup Copr config file
48+
env:
49+
# You need to have those secrets in your repo.
50+
# See also: https://copr.fedorainfracloud.org/api/.
51+
COPR_CONFIG: ${{ secrets.COPR_CONFIG }}
52+
run: |
53+
mkdir -p ~/.config
54+
echo "$COPR_CONFIG" > ~/.config/copr
55+
56+
- name: Trigger COPR build [tools]
57+
run: |
58+
copr-cli buildscm \
59+
--type git --clone-url https://github.com/f18m/cmonitor.git \
60+
--subdir tools --method make_srpm --commit ${{ github.head_ref || github.ref_name }} \
61+
cmonitor

collector/spec/collector.spec

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,8 @@ rm -rf %{buildroot}
7777

7878
%files
7979
%{_bindir}/cmonitor_collector
80+
81+
%changelog
82+
83+
* Thu Mar 27 2025 Francesco Montorsi <[email protected]>
84+
- Fixed RPM build for Fedora 42 with this changelog entry

0 commit comments

Comments
 (0)