-
Notifications
You must be signed in to change notification settings - Fork 383
216 lines (181 loc) · 6.9 KB
/
trigger_rebuild_packages.yml
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
name: Trigger to build package
on:
push:
branches:
- current
jobs:
changes:
runs-on: ubuntu-latest
env:
REF: main # Used for curl to trigger build package
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
- uses: dorny/paths-filter@v3
id: changes
with:
base: ${{ github.ref_name }}
filters: |
aws-gwlbtun:
- 'scripts/package-build/aws-gwlbtun/**'
ddclient:
- 'scripts/package-build/ddclient/**'
dropbear:
- 'scripts/package-build/dropbear/**'
ethtool:
- 'scripts/package-build/ethtool/**'
frr:
- 'scripts/package-build/frr/**'
frr_exporter:
- 'scripts/package-build/frr_exporter/**'
hostap:
- 'scripts/package-build/hostap/**'
hsflowd:
- 'scripts/package-build/hsflowd/**'
isc-dhcp:
- 'scripts/package-build/isc-dhcp/**'
kea:
- 'scripts/package-build/kea/**'
keepalived:
- 'scripts/package-build/keepalived/**'
linux-kernel:
- 'data/defaults.toml'
- 'scripts/package-build/linux-kernel/**'
ndppd:
- 'scripts/package-build/ndppd/**'
net-snmp:
- 'scripts/package-build/net-snmp/**'
netfilter:
- 'scripts/package-build/netfilter/**'
node_exporter:
- 'scripts/package-build/node_exporter/**'
opennhrp:
- 'scripts/package-build/opennhrp/**'
openvpn-otp:
- 'scripts/package-build/openvpn-otp/**'
owamp:
- 'scripts/package-build/owamp/**'
pam_tacplus:
- 'scripts/package-build/pam_tacplus/**'
pmacct:
- 'scripts/package-build/pmacct/**'
podman:
- 'scripts/package-build/podman/**'
pyhumps:
- 'scripts/package-build/pyhumps/**'
radvd:
- 'scripts/package-build/radvd/**'
strongswan:
- 'scripts/package-build/strongswan/**'
telegraf:
- 'scripts/package-build/telegraf/**'
waagent:
- 'scripts/package-build/waagent/**'
wide-dhcpv6:
- 'scripts/package-build/wide-dhcpv6/**'
xen-guest-agent:
- 'scripts/package-build/xen-guest-agent/**'
- name: Trigger builds for changed packages
run: |
set -eux
function trigger_build() {
PACKAGE_NAME=$1
echo "${PACKAGE_NAME} change detected!"
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.PAT }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ secrets.REMOTE_OWNER }}/${{ secrets.REMOTE_REUSE_REPO }}/actions/workflows/build-package.yml/dispatches \
-d '{"ref": "${{ env.REF }}", "inputs":{"package_name":"'"$PACKAGE_NAME"'", "gpg_key_id": "${{ secrets.GPG_KEY_ID }}", "package_branch": "${{ github.ref_name }}"}}'
}
# Trigger builds based on detected changes
if [ "${{ steps.changes.outputs.aws-gwlbtun }}" == "true" ]; then
trigger_build "aws-gwlbtun"
fi
if [ "${{ steps.changes.outputs.ddclient }}" == "true" ]; then
trigger_build "ddclient"
fi
if [ "${{ steps.changes.outputs.dropbear }}" == "true" ]; then
trigger_build "dropbear"
fi
if [ "${{ steps.changes.outputs.ethtool }}" == "true" ]; then
trigger_build "ethtool"
fi
if [ "${{ steps.changes.outputs.frr }}" == "true" ]; then
trigger_build "frr"
fi
if [ "${{ steps.changes.outputs.frr_exporter }}" == "true" ]; then
trigger_build "frr_exporter"
fi
if [ "${{ steps.changes.outputs.hostap }}" == "true" ]; then
trigger_build "hostap"
fi
if [ "${{ steps.changes.outputs.hsflowd }}" == "true" ]; then
trigger_build "hsflowd"
fi
if [ "${{ steps.changes.outputs.isc-dhcp }}" == "true" ]; then
trigger_build "isc-dhcp"
fi
if [ "${{ steps.changes.outputs.kea }}" == "true" ]; then
trigger_build "kea"
fi
if [ "${{ steps.changes.outputs.keepalived }}" == "true" ]; then
trigger_build "keepalived"
fi
if [ "${{ steps.changes.outputs.linux-kernel }}" == "true" ]; then
trigger_build "linux-kernel"
fi
if [ "${{ steps.changes.outputs.ndppd }}" == "true" ]; then
trigger_build "ndppd"
fi
if [ "${{ steps.changes.outputs.net-snmp }}" == "true" ]; then
trigger_build "net-snmp"
fi
if [ "${{ steps.changes.outputs.netfilter }}" == "true" ]; then
trigger_build "netfilter"
fi
if [ "${{ steps.changes.outputs.node_exporter }}" == "true" ]; then
trigger_build "node_exporter"
fi
if [ "${{ steps.changes.outputs.opennhrp }}" == "true" ]; then
trigger_build "opennhrp"
fi
if [ "${{ steps.changes.outputs.openvpn-otp }}" == "true" ]; then
trigger_build "openvpn-otp"
fi
if [ "${{ steps.changes.outputs.owamp }}" == "true" ]; then
trigger_build "owamp"
fi
if [ "${{ steps.changes.outputs.pam_tacplus }}" == "true" ]; then
trigger_build "pam_tacplus"
fi
if [ "${{ steps.changes.outputs.pmacct }}" == "true" ]; then
trigger_build "pmacct"
fi
if [ "${{ steps.changes.outputs.podman }}" == "true" ]; then
trigger_build "podman"
fi
if [ "${{ steps.changes.outputs.pyhumps }}" == "true" ]; then
trigger_build "pyhumps"
fi
if [ "${{ steps.changes.outputs.radvd }}" == "true" ]; then
trigger_build "radvd"
fi
if [ "${{ steps.changes.outputs.strongswan }}" == "true" ]; then
trigger_build "strongswan"
fi
if [ "${{ steps.changes.outputs.telegraf }}" == "true" ]; then
trigger_build "telegraf"
fi
if [ "${{ steps.changes.outputs.waagent }}" == "true" ]; then
trigger_build "waagent"
fi
if [ "${{ steps.changes.outputs.wide-dhcpv6 }}" == "true" ]; then
trigger_build "ethtool"
fi
if [ "${{ steps.changes.outputs.xen-guest-agent }}" == "true" ]; then
trigger_build "xen-guest-agent"
fi