| ... | @@ -5,7 +5,7 @@ on: | ... | @@ -5,7 +5,7 @@ on: |
| 5 | tags: | 5 | tags: |
| 6 | - "v*.*.*" | 6 | - "v*.*.*" |
| 7 | schedule: | 7 | schedule: |
| 8 | - cron: "0 9 * * *" | 8 | - cron: "0 */3 * * *" |
| 9 | workflow_dispatch: | 9 | workflow_dispatch: |
| 10 | inputs: | 10 | inputs: |
| 11 | channel: | 11 | channel: |
| ... | @@ -26,8 +26,45 @@ permissions: | ... | @@ -26,8 +26,45 @@ permissions: |
| 26 | id-token: write | 26 | id-token: write |
| 27 | | 27 | |
| 28 | jobs: | 28 | jobs: |
| | 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 | |
| 29 | preflight: | 62 | preflight: |
| 30 | name: Preflight | 63 | name: Preflight |
| | 64 | needs: [check_changes] |
| | 65 | if: | |
| | 66 | !failure() && !cancelled() && |
| | 67 | (github.event_name != 'schedule' || needs.check_changes.outputs.has_changes == 'true') |
| 31 | runs-on: blacksmith-8vcpu-ubuntu-2404 | 68 | runs-on: blacksmith-8vcpu-ubuntu-2404 |
| 32 | timeout-minutes: 10 | 69 | timeout-minutes: 10 |
| 33 | outputs: | 70 | outputs: |