fix(ci): no 404 window when a test build is replaced; merged PRs keep their build until Preview has it (#2635)

* fix(ci): a test build's files outlive the catalog that names them, and a merged PR's build lasts until Preview carries it

- A new push's PR release keeps the previous push's files until the catalog names the new
  ones, then five minutes more, so a download started from the old catalog still finds its APK.
  The app also reloads the catalog and retries once when a test build's download fails.
- Closing a PR without merging still deletes its test build. A merged PR's build stays, and
  stays listed, until the newest Preview build was built from a main holding the merge, or
  three days pass (docs-only merges build no Preview). Main's build, the PR cleanup and the
  sweep share one script for this.

* fix(ci): name the current push's APK in the catalog and prune nothing it still names

* fix(ci): only a Preview with every APK carries a merge or is offered

* fix(ci): publish no preview while none has every APK

* test(ci): build_catalog publishes no preview while its APKs are uploading
This commit is contained in:
Kurt Himebauch authored and GitHub committed 2026-11-14 23:40:08 -05:00
1 parent 059711cfe1
commit 6f7d7f827f
9 files changed
+336 -72

No files matched your search

+32
View File
@@ -992,3 +992,35 @@ jobs:
if: ${{ always() && github.event_name != 'pull_request' && github.ref == 'refs/heads/main' && needs.announce.result != 'skipped' }}
uses: ./.github/workflows/update-catalog.yml
secrets: inherit
retire-tests:
needs: catalog
if: ${{ always() && github.event_name != 'pull_request' && github.ref == 'refs/heads/main' && needs.catalog.result == 'success' }}
runs-on: ubuntu-24.04
timeout-minutes: 10
permissions:
contents: read
pull-requests: read
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
persist-credentials: false
- uses: actions/create-github-app-token@v2
id: ci-token
with:
app-id: ${{ vars.DROIDDECK_CI_APP_ID }}
private-key: ${{ secrets.DROIDDECK_CI_APP_KEY }}
owner: Droid-Deck
repositories: DroidDeck-CI
- name: Delete the test builds this Preview build replaces
env:
SOURCE_GITHUB_TOKEN: ${{ github.token }}
CI_GITHUB_TOKEN: ${{ steps.ci-token.outputs.token }}
run: python3 tools/release/retire_test_builds.py
catalog-after-retire:
needs: retire-tests
if: ${{ always() && needs.retire-tests.result == 'success' }}
uses: ./.github/workflows/update-catalog.yml
secrets: inherit