|
44 | 44 | : "${RELEASE_PUSH_TAG:=${RELEASE_DEFAULT}}" |
45 | 45 | : "${RELEASE_SIGN:=${RELEASE_DEFAULT}}" |
46 | 46 | : "${RELEASE_UPLOAD:=${RELEASE_DEFAULT}}" |
| 47 | +: "${RELEASE_WATCH:=${RELEASE_DEFAULT}}" |
47 | 48 | : "${RELEASE_WATCH_INTERVAL:=30}" |
48 | 49 |
|
49 | 50 | cd "${SOURCE_TOP_DIR}" |
@@ -97,29 +98,33 @@ if [ "${RELEASE_SIGN}" -gt 0 ]; then |
97 | 98 | done |
98 | 99 |
|
99 | 100 | echo "Found GitHub Actions workflow with ID: ${run_id}" |
100 | | - while true; do |
101 | | - run_status=$(gh run view \ |
102 | | - --repo "${repository}" \ |
103 | | - --json 'status,conclusion' \ |
104 | | - --jq '.status + " " + (.conclusion // "")' \ |
105 | | - "${run_id}") |
106 | | - echo "$(date -u '+%Y-%m-%dT%H:%M:%SZ') GitHub Actions workflow status: ${run_status}" |
107 | | - gh run view \ |
108 | | - --repo "${repository}" \ |
109 | | - --json jobs \ |
110 | | - --jq '.jobs[] | " " + .name + ": " + .status + " " + (.conclusion // "")' \ |
111 | | - "${run_id}" |
112 | | - case "${run_status}" in |
113 | | - "completed success") |
114 | | - break |
115 | | - ;; |
116 | | - completed\ *) |
117 | | - echo "GitHub Actions workflow did not complete successfully: ${run_status}" |
118 | | - exit 1 |
119 | | - ;; |
120 | | - esac |
121 | | - sleep "${RELEASE_WATCH_INTERVAL}" |
122 | | - done |
| 101 | + if [ "${RELEASE_WATCH}" -gt 0 ]; then |
| 102 | + gh run watch --repo "${repository}" --exit-status "${run_id}" |
| 103 | + else |
| 104 | + while true; do |
| 105 | + run_status=$(gh run view \ |
| 106 | + --repo "${repository}" \ |
| 107 | + --json 'status,conclusion' \ |
| 108 | + --jq '.status + " " + (.conclusion // "")' \ |
| 109 | + "${run_id}") |
| 110 | + echo "$(date -u '+%Y-%m-%dT%H:%M:%SZ') GitHub Actions workflow status: ${run_status}" |
| 111 | + gh run view \ |
| 112 | + --repo "${repository}" \ |
| 113 | + --json jobs \ |
| 114 | + --jq '.jobs[] | " " + .name + ": " + .status + " " + (.conclusion // "")' \ |
| 115 | + "${run_id}" |
| 116 | + case "${run_status}" in |
| 117 | + "completed success") |
| 118 | + break |
| 119 | + ;; |
| 120 | + completed\ *) |
| 121 | + echo "GitHub Actions workflow did not complete successfully: ${run_status}" |
| 122 | + exit 1 |
| 123 | + ;; |
| 124 | + esac |
| 125 | + sleep "${RELEASE_WATCH_INTERVAL}" |
| 126 | + done |
| 127 | + fi |
123 | 128 |
|
124 | 129 | mkdir -p "${rc_id}" |
125 | 130 |
|
|
0 commit comments