Skip to content

Commit a6a4f08

Browse files
authored
Merge pull request #752 from sever-sever/T6674-actions
T6674: Add workflow to rebuild packages
2 parents b82afa2 + ceb91a2 commit a6a4f08

File tree

1 file changed

+197
-0
lines changed

1 file changed

+197
-0
lines changed
Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
name: Trigger to build package
2+
3+
on:
4+
push:
5+
branches:
6+
- current
7+
8+
jobs:
9+
changes:
10+
runs-on: ubuntu-latest
11+
12+
env:
13+
REF: main # Used for curl to trigger build package
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
ref: current
20+
21+
- uses: dorny/paths-filter@v3
22+
id: changes
23+
with:
24+
base: current
25+
filters: |
26+
aws-gwlbtun:
27+
- 'scripts/package-build/aws-gwlbtun/**'
28+
ddclient:
29+
- 'scripts/package-build/ddclient/**'
30+
dropbear:
31+
- 'scripts/package-build/dropbear/**'
32+
ethtool:
33+
- 'scripts/package-build/ethtool/**'
34+
frr:
35+
- 'scripts/package-build/frr/**'
36+
hostap:
37+
- 'scripts/package-build/hostap/**'
38+
hsflowd:
39+
- 'scripts/package-build/hsflowd/**'
40+
isc-dhcp:
41+
- 'scripts/package-build/isc-dhcp/**'
42+
kea:
43+
- 'scripts/package-build/kea/**'
44+
keepalived:
45+
- 'scripts/package-build/keepalived/**'
46+
linux-kernel:
47+
- 'scripts/package-build/linux-kernel/**'
48+
ndppd:
49+
- 'scripts/package-build/ndppd/**'
50+
net-snmp:
51+
- 'scripts/package-build/net-snmp/**'
52+
netfilter:
53+
- 'scripts/package-build/netfilter/**'
54+
opennhrp:
55+
- 'scripts/package-build/opennhrp/**'
56+
openvpn-otp:
57+
- 'scripts/package-build/openvpn-otp/**'
58+
owamp:
59+
- 'scripts/package-build/owamp/**'
60+
pam_tacplus:
61+
- 'scripts/package-build/pam_tacplus/**'
62+
pmacct:
63+
- 'scripts/package-build/pmacct/**'
64+
podman:
65+
- 'scripts/package-build/podman/**'
66+
pyhumps:
67+
- 'scripts/package-build/pyhumps/**'
68+
radvd:
69+
- 'scripts/package-build/radvd/**'
70+
strongswan:
71+
- 'scripts/package-build/strongswan/**'
72+
telegraf:
73+
- 'scripts/package-build/telegraf/**'
74+
waagent:
75+
- 'scripts/package-build/waagent/**'
76+
wide-dhcpv6:
77+
- 'scripts/package-build/wide-dhcpv6/**'
78+
79+
- name: Trigger builds for changed packages
80+
run: |
81+
set -eux
82+
function trigger_build() {
83+
PACKAGE_NAME=$1
84+
echo "${PACKAGE_NAME} change detected!"
85+
curl -L \
86+
-X POST \
87+
-H "Accept: application/vnd.github+json" \
88+
-H "Authorization: Bearer ${{ secrets.PAT }}" \
89+
-H "X-GitHub-Api-Version: 2022-11-28" \
90+
https://api.github.com/repos/${{ secrets.REMOTE_OWNER }}/${{ secrets.REMOTE_REUSE_REPO }}/actions/workflows/build-package.yml/dispatches \
91+
-d '{"ref": "${{ env.REF }}", "inputs":{"package_name":"'"$PACKAGE_NAME"'"}}'
92+
}
93+
94+
# Trigger builds based on detected changes
95+
if [ "${{ steps.changes.outputs.aws-gwlbtun }}" == "true" ]; then
96+
trigger_build "aws-gwlbtun"
97+
fi
98+
99+
if [ "${{ steps.changes.outputs.ddclient }}" == "true" ]; then
100+
trigger_build "ddclient"
101+
fi
102+
103+
if [ "${{ steps.changes.outputs.dropbear }}" == "true" ]; then
104+
trigger_build "dropbear"
105+
fi
106+
107+
if [ "${{ steps.changes.outputs.ethtool }}" == "true" ]; then
108+
trigger_build "ethtool"
109+
fi
110+
111+
if [ "${{ steps.changes.outputs.frr }}" == "true" ]; then
112+
trigger_build "frr"
113+
fi
114+
115+
if [ "${{ steps.changes.outputs.hostap }}" == "true" ]; then
116+
trigger_build "hostap"
117+
fi
118+
119+
if [ "${{ steps.changes.outputs.hsflowd }}" == "true" ]; then
120+
trigger_build "hsflowd"
121+
fi
122+
123+
if [ "${{ steps.changes.outputs.isc-dhcp }}" == "true" ]; then
124+
trigger_build "isc-dhcp"
125+
fi
126+
127+
if [ "${{ steps.changes.outputs.kea }}" == "true" ]; then
128+
trigger_build "kea"
129+
fi
130+
131+
if [ "${{ steps.changes.outputs.keepalived }}" == "true" ]; then
132+
trigger_build "keepalived"
133+
fi
134+
135+
if [ "${{ steps.changes.outputs.linux-kernel }}" == "true" ]; then
136+
trigger_build "linux-kernel"
137+
fi
138+
139+
if [ "${{ steps.changes.outputs.ndppd }}" == "true" ]; then
140+
trigger_build "ndppd"
141+
fi
142+
143+
if [ "${{ steps.changes.outputs.net-snmp }}" == "true" ]; then
144+
trigger_build "net-snmp"
145+
fi
146+
147+
if [ "${{ steps.changes.outputs.netfilter }}" == "true" ]; then
148+
trigger_build "netfilter"
149+
fi
150+
151+
if [ "${{ steps.changes.outputs.opennhrp }}" == "true" ]; then
152+
trigger_build "opennhrp"
153+
fi
154+
155+
if [ "${{ steps.changes.outputs.openvpn-otp }}" == "true" ]; then
156+
trigger_build "openvpn-otp"
157+
fi
158+
159+
if [ "${{ steps.changes.outputs.owamp }}" == "true" ]; then
160+
trigger_build "owamp"
161+
fi
162+
163+
if [ "${{ steps.changes.outputs.pam_tacplus }}" == "true" ]; then
164+
trigger_build "pam_tacplus"
165+
fi
166+
167+
if [ "${{ steps.changes.outputs.pmacct }}" == "true" ]; then
168+
trigger_build "pmacct"
169+
fi
170+
171+
if [ "${{ steps.changes.outputs.podman }}" == "true" ]; then
172+
trigger_build "podman"
173+
fi
174+
175+
if [ "${{ steps.changes.outputs.pyhumps }}" == "true" ]; then
176+
trigger_build "pyhumps"
177+
fi
178+
179+
if [ "${{ steps.changes.outputs.radvd }}" == "true" ]; then
180+
trigger_build "radvd"
181+
fi
182+
183+
if [ "${{ steps.changes.outputs.strongswan }}" == "true" ]; then
184+
trigger_build "strongswan"
185+
fi
186+
187+
if [ "${{ steps.changes.outputs.telegraf }}" == "true" ]; then
188+
trigger_build "telegraf"
189+
fi
190+
191+
if [ "${{ steps.changes.outputs.waagent }}" == "true" ]; then
192+
trigger_build "waagent"
193+
fi
194+
195+
if [ "${{ steps.changes.outputs.wide-dhcpv6 }}" == "true" ]; then
196+
trigger_build "ethtool"
197+
fi

0 commit comments

Comments
 (0)