authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-04-17 11:39:20-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-04-17 11:39:20-07:00
log52a60678026549f8db66165e254c49eecfb69920
tree518e604b6501e1295f0e417275ab46a3fed92b81
parent721b6b4c6f596bd1d1b3af585ed9c62c4b6f72ab
signature Signed by PGP key B5690EEEBB952194

Throttle nightly release workflow to every 3 hours (#2134)


1 files changed, 38 insertions(+), 1 deletions(-)

.github/workflows/release.yml+38-1
......@@ -5,7 +5,7 @@ on:
55 tags:
66 - "v*.*.*"
77 schedule:
8 - cron: "0 9 * * *"
8 - cron: "0 */3 * * *"
99 workflow_dispatch:
1010 inputs:
1111 channel:
......@@ -26,8 +26,45 @@ permissions:
2626 id-token: write
2727
2828jobs:
29 check_changes:
30 name: Check for changes since last nightly
31 if: github.event_name == 'schedule'
32 runs-on: ubuntu-24.04
33 outputs:
34 has_changes: ${{ steps.check.outputs.has_changes }}
35 steps:
36 - name: Checkout
37 uses: actions/checkout@v6
38 with:
39 fetch-depth: 0
40
41 - id: check
42 name: Compare HEAD to last nightly tag
43 run: |
44 last_nightly_tag=$(git tag --list 'nightly-v*' --sort=-creatordate | head -n 1)
45 if [[ -z "$last_nightly_tag" ]]; then
46 echo "No previous nightly tag found. Proceeding with release."
47 echo "has_changes=true" >> "$GITHUB_OUTPUT"
48 exit 0
49 fi
50
51 last_nightly_sha=$(git rev-parse "$last_nightly_tag^{commit}")
52 head_sha=$(git rev-parse HEAD)
53
54 if [[ "$last_nightly_sha" == "$head_sha" ]]; then
55 echo "No changes on main since last nightly release ($last_nightly_tag). Skipping."
56 echo "has_changes=false" >> "$GITHUB_OUTPUT"
57 else
58 echo "Changes detected on main since $last_nightly_tag ($last_nightly_sha → $head_sha). Proceeding."
59 echo "has_changes=true" >> "$GITHUB_OUTPUT"
60 fi
61
2962 preflight:
3063 name: Preflight
64 needs: [check_changes]
65 if: |
66 !failure() && !cancelled() &&
67 (github.event_name != 'schedule' || needs.check_changes.outputs.has_changes == 'true')
3168 runs-on: blacksmith-8vcpu-ubuntu-2404
3269 timeout-minutes: 10
3370 outputs: