-
Notifications
You must be signed in to change notification settings - Fork 12
340 lines (297 loc) · 15.1 KB
/
trigger-fedora.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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
---
name: Fedora compose trigger
on:
workflow_dispatch:
schedule:
- cron: '0 4 * * *'
- cron: '0 16 * * *'
env:
COMPOSE_URL_rawhide: https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide
COMPOSE_URL_F39: https://dl.fedoraproject.org/pub/fedora/linux/development/39
UPDATES_URL_F39: https://dl.fedoraproject.org/pub/fedora/linux/development/39
COMPOSE_URL_F38: https://dl.fedoraproject.org/pub/fedora/linux/releases/38
UPDATES_URL_F38: https://dl.fedoraproject.org/pub/fedora/linux/updates/38
COMPOSE_URL_F37: https://dl.fedoraproject.org/pub/fedora/linux/releases/37
UPDATES_URL_F37: https://dl.fedoraproject.org/pub/fedora/linux/updates/37
jobs:
check-compose:
# Do not run this job on any fork repos
if: github.repository == 'virt-s1/rhel-edge'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check if fedora rawhide compose is new
id: check_compose_id
run: |
curl -s "${COMPOSE_URL_rawhide}/COMPOSE_ID" --output COMPOSE_ID
COMPOSE_ID=$(cat COMPOSE_ID)
TESTED_COMPOSE=( $( cat compose/compose.fedora ) )
if [[ " ${TESTED_COMPOSE[*]} " =~ "$COMPOSE_ID" ]]; then
COMPOSE_ID="false"
fi
if [[ "$COMPOSE_ID" != "false" ]]; then
gh pr list -R virt-s1/rhel-edge --state open --json title --jq '.[].title' > PR_LIST
PR_LIST=$(cat PR_LIST)
if [[ $PR_LIST == *"$COMPOSE_ID"* ]]; then
echo "pr_running=true" >> $GITHUB_OUTPUT
else
echo "pr_running=false" >> $GITHUB_OUTPUT
fi
OSBUILD_VERSION=$(curl -s "${COMPOSE_URL_rawhide}/Everything/x86_64/os/Packages/o/" | grep -ioE ">osbuild-[0-9].*<" | tr -d "><")
OSBUILD_COMPOSER_VERSION=$(curl -s "${COMPOSE_URL_rawhide}/Everything/x86_64/os/Packages/o/" | grep -ioE ">osbuild-composer-[0-9].*<" | tr -d "><")
COMPOSER_CLI_VERSION=$(curl -s "${COMPOSE_URL_rawhide}/Everything/x86_64/os/Packages/w/" | grep -ioE ">weldr-client-[0-9].*<" | tr -d "><")
echo "osbuild_version=$OSBUILD_VERSION" >> $GITHUB_OUTPUT
echo "osbuild_composer_version=$OSBUILD_COMPOSER_VERSION" >> $GITHUB_OUTPUT
echo "composer_cli_version=$COMPOSER_CLI_VERSION" >> $GITHUB_OUTPUT
else
echo "osbuild_version=Null" >> $GITHUB_OUTPUT
echo "osbuild_composer_version=Null" >> $GITHUB_OUTPUT
echo "composer_cli_version=Null" >> $GITHUB_OUTPUT
fi
echo "rawhide_compose=$COMPOSE_ID" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
outputs:
rawhide_compose: ${{ steps.check_compose_id.outputs.rawhide_compose }}
osbuild_version: ${{ steps.check_compose_id.outputs.osbuild_version }}
osbuild_composer_version: ${{ steps.check_compose_id.outputs.osbuild_composer_version }}
composer_cli_version: ${{ steps.check_compose_id.outputs.composer_cli_version }}
pr_running: ${{ steps.check_compose_id.outputs.pr_running }}
fedora-rawhide:
needs: check-compose
if: ${{ needs.check-compose.outputs.rawhide_compose != 'false' && needs.check-compose.outputs.pr_running == 'false' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Add new compose id in compose.fedora
run: |
compose_id="${{ needs.check-compose.outputs.rawhide_compose }}"
echo $compose_id >> compose/compose.fedora
cat compose/compose.fedora
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "${{ needs.check-compose.outputs.rawhide_compose }} - ${{ steps.date.outputs.date }}"
committer: cloudkitebot <[email protected]>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
branch: cpr
branch-suffix: random
delete-branch: true
title: "${{ needs.check-compose.outputs.rawhide_compose }} - ${{ steps.date.outputs.date }}"
labels: auto-merge,fedora-rawhide
body: |
Fedora rawhide compose ${{ needs.check-compose.outputs.rawhide_compose }}
- Date: ${{ steps.date.outputs.date }}
- Compose URL: ${{ env.COMPOSE_URL_rawhide }}
- Packages:
- ${{ needs.check-compose.outputs.osbuild_version }}
- ${{ needs.check-compose.outputs.osbuild_composer_version }}
- ${{ needs.check-compose.outputs.composer_cli_version }}
- name: Enable Pull Request Automerge
if: steps.cpr.outputs.pull-request-operation == 'created'
uses: peter-evans/enable-pull-request-automerge@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
merge-method: rebase
- name: Add a comment to trigger test workflow
uses: peter-evans/create-or-update-comment@v2
with:
token: ${{ secrets.PAT }}
issue-number: ${{ steps.cpr.outputs.pull-request-number }}
body: /test-rawhide
- name: Create a project card to track compose test result
uses: peter-evans/create-or-update-project-card@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
project-name: Fedora Compose Test
column-name: Fedora-rawhide
issue-number: ${{ steps.cpr.outputs.pull-request-number }}
fedora-39:
# Do not need check-compose and make "workflow_dispatch" work for this job
if: github.repository == 'virt-s1/rhel-edge' && github.event.schedule != '0 4 * * *'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get package version
id: package_version
run: |
curl -s "${COMPOSE_URL_F39}/COMPOSE_ID" --output COMPOSE_ID_F39
COMPOSE_ID_F39=$(cat COMPOSE_ID_F39)
OSBUILD_VERSION_F39=$(curl -s "${UPDATES_URL_F39}/Everything/x86_64/Packages/o/" | grep -ioE ">osbuild-[0-9].*<" | tr -d "><")
OSBUILD_COMPOSER_VERSION_F39=$(curl -s "${UPDATES_URL_F39}/Everything/x86_64/Packages/o/" | grep -ioE ">osbuild-composer-[0-9].*<" | tr -d "><")
COMPOSER_CLI_VERSION_F39=$(curl -s "${COMPOSE_URL_F39}/Everything/x86_64/os/Packages/w/" | grep -ioE ">weldr-client-[0-9].*<" | tr -d "><")
echo "osbuild_version_f39=$OSBUILD_VERSION_F39" >> $GITHUB_OUTPUT
echo "osbuild_composer_version_f39=$OSBUILD_COMPOSER_VERSION_F39" >> $GITHUB_OUTPUT
echo "composer_cli_version_f39=$COMPOSER_CLI_VERSION_F39" >> $GITHUB_OUTPUT
echo "f39_compose=$COMPOSE_ID_F39" >> $GITHUB_OUTPUT
- name: Add new compose id in compose.f39
run: |
compose_id="${{ steps.package_version.outputs.f39_compose }}"
echo $compose_id >> compose/compose.f39
cat compose/compose.f39
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Fedora 39 Daily Compose Test - ${{ steps.date.outputs.date }}"
committer: cloudkitebot <[email protected]>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
branch: cpr
branch-suffix: random
delete-branch: true
title: " Fedora 39 Daily Compose Test- ${{ steps.date.outputs.date }}"
labels: DO_NOT_MERGE,fedora-39
body: |
Fedora 39 compose ${{ steps.package_version.outputs.f39_compose }}
- Date: ${{ steps.date.outputs.date }}
- Compose URL: ${{ env.COMPOSE_URL_F39 }}
- Updates URL: ${{ env.UPDATES_URL_F39 }}
- Packages:
- ${{ steps.package_version.outputs.osbuild_version_f39 }}
- ${{ steps.package_version.outputs.osbuild_composer_version_f39 }}
- ${{ steps.package_version.outputs.composer_cli_version_f39 }}
- name: Add a comment to trigger test workflow
uses: peter-evans/create-or-update-comment@v2
with:
token: ${{ secrets.PAT }}
issue-number: ${{ steps.cpr.outputs.pull-request-number }}
body: /test-f39
- name: Create a project card to track compose test result
uses: peter-evans/create-or-update-project-card@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
project-name: Fedora Compose Test
column-name: Fedora-39
issue-number: ${{ steps.cpr.outputs.pull-request-number }}
fedora-38:
# Do not need check-compose and make "workflow_dispatch" work for this job
if: github.repository == 'virt-s1/rhel-edge' && github.event.schedule != '0 16 * * *'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get package version
id: package_version
run: |
curl -s "${COMPOSE_URL_F38}/COMPOSE_ID" --output COMPOSE_ID_F38
COMPOSE_ID_F38=$(cat COMPOSE_ID_F38)
OSBUILD_VERSION_F38=$(curl -s "${UPDATES_URL_F38}/Everything/x86_64/Packages/o/" | grep -ioE ">osbuild-[0-9].*<" | tr -d "><")
OSBUILD_COMPOSER_VERSION_F38=$(curl -s "${UPDATES_URL_F38}/Everything/x86_64/Packages/o/" | grep -ioE ">osbuild-composer-[0-9].*<" | tr -d "><")
COMPOSER_CLI_VERSION_F38=$(curl -s "${COMPOSE_URL_F38}/Everything/x86_64/os/Packages/w/" | grep -ioE ">weldr-client-[0-9].*<" | tr -d "><")
echo "osbuild_version_f38=$OSBUILD_VERSION_F38" >> $GITHUB_OUTPUT
echo "osbuild_composer_version_f38=$OSBUILD_COMPOSER_VERSION_F38" >> $GITHUB_OUTPUT
echo "composer_cli_version_f38=$COMPOSER_CLI_VERSION_F38" >> $GITHUB_OUTPUT
echo "f38_compose=$COMPOSE_ID_F38" >> $GITHUB_OUTPUT
- name: Add new compose id in compose.f38
run: |
compose_id="${{ steps.package_version.outputs.f38_compose }}"
echo $compose_id >> compose/compose.f38
cat compose/compose.f38
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Fedora 38 Daily Compose Test - ${{ steps.date.outputs.date }}"
committer: cloudkitebot <[email protected]>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
branch: cpr
branch-suffix: random
delete-branch: true
title: " Fedora 38 Daily Compose Test- ${{ steps.date.outputs.date }}"
labels: DO_NOT_MERGE,fedora-38
body: |
Fedora 38 compose ${{ steps.package_version.outputs.f38_compose }}
- Date: ${{ steps.date.outputs.date }}
- Compose URL: ${{ env.COMPOSE_URL_F38 }}
- Updates URL: ${{ env.UPDATES_URL_F38 }}
- Packages:
- ${{ steps.package_version.outputs.osbuild_version_f38 }}
- ${{ steps.package_version.outputs.osbuild_composer_version_f38 }}
- ${{ steps.package_version.outputs.composer_cli_version_f38 }}
- name: Add a comment to trigger test workflow
uses: peter-evans/create-or-update-comment@v2
with:
token: ${{ secrets.PAT }}
issue-number: ${{ steps.cpr.outputs.pull-request-number }}
body: /test-f38
- name: Create a project card to track compose test result
uses: peter-evans/create-or-update-project-card@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
project-name: Fedora Compose Test
column-name: Fedora-38
issue-number: ${{ steps.cpr.outputs.pull-request-number }}
fedora-37:
# Do not need check-compose and make "workflow_dispatch" work for this job
if: github.repository == 'virt-s1/rhel-edge' && github.event.schedule != '0 4 * * *'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get package version
id: package_version
run: |
curl -s "${COMPOSE_URL_F37}/COMPOSE_ID" --output COMPOSE_ID_F37
COMPOSE_ID_F37=$(cat COMPOSE_ID_F37)
OSBUILD_VERSION_F37=$(curl -s "${UPDATES_URL_F37}/Everything/x86_64/Packages/o/" | grep -ioE ">osbuild-[0-9].*<" | tr -d "><")
OSBUILD_COMPOSER_VERSION_F37=$(curl -s "${UPDATES_URL_F37}/Everything/x86_64/Packages/o/" | grep -ioE ">osbuild-composer-[0-9].*<" | tr -d "><")
COMPOSER_CLI_VERSION_F37=$(curl -s "${COMPOSE_URL_F37}/Everything/x86_64/os/Packages/w/" | grep -ioE ">weldr-client-[0-9].*<" | tr -d "><")
echo "osbuild_version_f37=$OSBUILD_VERSION_F37" >> $GITHUB_OUTPUT
echo "osbuild_composer_version_f37=$OSBUILD_COMPOSER_VERSION_F37" >> $GITHUB_OUTPUT
echo "composer_cli_version_f37=$COMPOSER_CLI_VERSION_F37" >> $GITHUB_OUTPUT
echo "f37_compose=$COMPOSE_ID_F37" >> $GITHUB_OUTPUT
- name: Add new compose id in compose.f37
run: |
compose_id="${{ needs.check-compose.outputs.f37_compose }}"
echo $compose_id >> compose/compose.f37
cat compose/compose.f37
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Fedora 37 Daily Compose Test - ${{ steps.date.outputs.date }}"
committer: cloudkitebot <[email protected]>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
branch: cpr
branch-suffix: random
delete-branch: true
title: " Fedora 37 Daily Compose Test- ${{ steps.date.outputs.date }}"
labels: DO_NOT_MERGE,fedora-37
body: |
Fedora 37 compose ${{ steps.package_version.outputs.f37_compose }}
- Date: ${{ steps.date.outputs.date }}
- Compose URL: ${{ env.COMPOSE_URL_F37 }}
- Updates URL: ${{ env.UPDATES_URL_F37 }}
- Packages:
- ${{ steps.package_version.outputs.osbuild_version_f37 }}
- ${{ steps.package_version.outputs.osbuild_composer_version_f37 }}
- ${{ steps.package_version.outputs.composer_cli_version_f37 }}
- name: Add a comment to trigger test workflow
uses: peter-evans/create-or-update-comment@v2
with:
token: ${{ secrets.PAT }}
issue-number: ${{ steps.cpr.outputs.pull-request-number }}
body: /test-f37
- name: Create a project card to track compose test result
uses: peter-evans/create-or-update-project-card@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
project-name: Fedora Compose Test
column-name: Fedora-37
issue-number: ${{ steps.cpr.outputs.pull-request-number }}