diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 19c70aa6c..5ae795717 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -132,11 +132,27 @@ jobs: if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/lotus' }} runs-on: ubuntu-latest steps: + # [matrix #9] Debounce: a Tauri build takes ~30 min on the shared runner, + # so at most one bump per DEBOUNCE_MIN. Commits that land inside the + # window are picked up by cinny-desktop's nightly catch-up workflow (or a + # manual dispatch of it) — the desktop cadence no longer tracks every web + # commit. The bump is also skipped when nothing changed. - name: Bump cinny submodule env: TOKEN: ${{ secrets.RELEASE_TOKEN }} + DEBOUNCE_MIN: '60' run: | CINNY_SHA="${{ github.sha }}" + LAST=$(curl -fsSL -H "Authorization: token $TOKEN" \ + "https://code.lotusguild.org/api/v1/repos/LotusGuild/cinny-desktop/commits?sha=main&limit=1&stat=false&verification=false&files=false" \ + | python3 -c 'import sys,json; c=json.load(sys.stdin); print(c[0]["commit"]["committer"]["date"] if c else "")' 2>/dev/null || true) + if [ -n "$LAST" ]; then + AGE=$(python3 -c "import sys,datetime; d=datetime.datetime.fromisoformat(sys.argv[1].replace('Z','+00:00')); print(int((datetime.datetime.now(datetime.timezone.utc)-d).total_seconds()//60))" "$LAST") + if [ "$AGE" -lt "$DEBOUNCE_MIN" ]; then + echo "Last desktop bump was ${AGE} min ago (< ${DEBOUNCE_MIN}); skipping — the nightly catch-up will pick this up." + exit 0 + fi + fi git clone "https://x-access-token:$TOKEN@code.lotusguild.org/LotusGuild/cinny-desktop.git" desktop cd desktop git config user.email "ci@lotusguild.org"