forked from pieroproietti/penguins-eggs
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (50 loc) · 2.34 KB
/
00-all-packages-release.yml
File metadata and controls
63 lines (50 loc) · 2.34 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: '00 - all packages release'
on:
workflow_dispatch:
jobs:
trigger-all-releases:
name: Trigger di Rilascio Globale
runs-on: ubuntu-latest
permissions:
actions: write
contents: read # Necessario per gh run list
steps:
- name: Checkout del codice del repository
uses: actions/checkout@v4
- name: Avvia i workflow di pubblicazione in sequenza
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "Inizio a chiamare i singoli workflow in modo sequenziale..."
echo "Tutti i rilasci verranno eseguiti usando il codice dal branch 'master'."
# Lista dei workflow da eseguire in ordine
WORKFLOWS=(
"00-publish-debian-deb.yml"
"01-publish-fedora-rpm.yml"
"02-publish-opensuse-rpm.yml"
"03-publish-enterprise-linux.yml"
"04-publish-archlinux.yml"
"05-publish-manjaro.yml"
"06-publish-alpine.yml"
)
for workflow_file in "${WORKFLOWS[@]}"; do
echo "------------------------------------------------------"
echo "🚀 Avvio del workflow: ${workflow_file}"
gh workflow run "${workflow_file}" --ref master
# Attende un istante per dare tempo a GitHub di registrare l'esecuzione.
sleep 5
# Recupera l'ID dell'ultima esecuzione avviata per quel workflow sul branch master.
echo "🔍 Recupero l'ID dell'esecuzione..."
RUN_ID=$(gh run list --workflow="${workflow_file}" --branch="master" --limit=1 --json databaseId -q '.[0].databaseId')
if [ -z "$RUN_ID" ]; then
echo "❌ Impossibile trovare l'ID dell'esecuzione per ${workflow_file}. Annullamento."
exit 1
fi
echo "⏳ Attendo il completamento dell'esecuzione con ID: ${RUN_ID}..."
# Si mette in ascolto e attende che la run termini.
# Il comando esce con un codice di errore se la run fallisce.
gh run watch "${RUN_ID}" --exit-status
echo "✅ Workflow ${workflow_file} completato con successo."
done
echo "------------------------------------------------------"
echo "🎉 Processo completato. Tutti i workflow sono stati eseguiti in sequenza."