Showing the changes to .github (1 of 2 files). Show all
Unified · Split
| @@ -69,11 +69,10 @@ on: · 68 unmodified lines | ||
| 69 | 69 | schedule: |
| 70 | 70 | - cron: "17,47 * * * *" |
| 71 | 71 | |
| 72 | −# Serialize runs so OTAs publish in merge order. GitHub keeps at most one | |
| 73 | −# queued run per group, so a burst of merges collapses into one run of the | |
| 74 | −# newest commit — intermediate commits don't need their own OTA. | |
| 72 | +# Serialize push releases so OTAs publish in merge order. Scheduled retries | |
| 73 | +# use a separate group and cannot replace a queued push that must start builds. | |
| 75 | 74 | concurrency: |
| 76 | − group: mobile-eas-production | |
| 75 | + group: mobile-eas-production-${{ github.event_name == 'schedule' && 'scheduled' || 'release' }} | |
| 77 | 76 | cancel-in-progress: false |
| 78 | 77 | |
| 79 | 78 | jobs: |
| @@ -277,9 +276,16 @@ jobs: · 197 unmodified lines | ||
| 277 | 276 | matching="$(eas build:list --platform "$platform" --build-profile production --status finished --fingerprint-hash "$hash" --limit 1 --json --non-interactive | jq 'length')" |
| 278 | 277 | if [ "$matching" -gt 0 ]; then |
| 279 | 278 | if [ "$GITHUB_EVENT_NAME" = "schedule" ]; then |
| 280 | − group="$(eas update:list --branch production --platform "$platform" --runtime-version "$hash" --limit 1 --json --non-interactive | jq -r '.currentPage[0].group // empty')" | |
| 279 | + updates="$(eas update:list --branch production --platform "$platform" --runtime-version "$hash" --limit 2 --json --non-interactive)" | |
| 280 | + group="$(jq -r '.currentPage[0].group // empty' <<< "$updates")" | |
| 281 | 281 | if [ -n "$group" ]; then |
| 282 | − published_commit="$(eas update:view "$group" --json | jq -r --arg platform "$platform" '.[] | select(.platform == $platform) | .gitCommitHash // empty')" | |
| 282 | + update="$(eas update:view "$group" --json | jq -c --arg platform "$platform" 'map(select(.platform == $platform)) | .[0] // {}')" | |
| 283 | + if [ "$(jq -r '.isRollBackToEmbedded // false' <<< "$update")" = "true" ]; then | |
| 284 | + echo "$platform: preserving production rollback to the embedded update" | |
| 285 | + continue | |
| 286 | + fi | |
| 287 | + | |
| 288 | + published_commit="$(jq -r '.gitCommitHash // empty' <<< "$update")" | |
| 283 | 289 | if [ -n "$published_commit" ] && |
| 284 | 290 | git cat-file -e "$published_commit^{commit}" 2>/dev/null && |
| 285 | 291 | git -C "$(git rev-parse --show-toplevel)" diff --quiet "$published_commit" HEAD -- \ |
| @@ -296,6 +302,18 @@ jobs: · 10 unmodified lines | ||
| 296 | 302 | echo "$platform: production OTA already contains the latest mobile changes" |
| 297 | 303 | continue |
| 298 | 304 | fi |
| 305 | + | |
| 306 | + previous_group="$(jq -r '.currentPage[1].group // empty' <<< "$updates")" | |
| 307 | + if [ -n "$published_commit" ] && [ -n "$previous_group" ]; then | |
| 308 | + previous_commit="$(eas update:view "$previous_group" --json | jq -r --arg platform "$platform" '.[] | select(.platform == $platform) | .gitCommitHash // empty')" | |
| 309 | + if [ -n "$previous_commit" ] && | |
| 310 | + [ "$published_commit" != "$previous_commit" ] && | |
| 311 | + git cat-file -e "$previous_commit^{commit}" 2>/dev/null && | |
| 312 | + git merge-base --is-ancestor "$published_commit" "$previous_commit"; then | |
| 313 | + echo "$platform: preserving production rollback to an earlier update" | |
| 314 | + continue | |
| 315 | + fi | |
| 316 | + fi | |
| 299 | 317 | fi |
| 300 | 318 | fi |
| 301 | 319 | |