nightly.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # Copyright (c) 2008-2022 the Urho3D project
  2. # License: MIT
  3. ---
  4. name: Nightly
  5. on:
  6. workflow_dispatch:
  7. schedule: [ cron: '0 0 * * *' ]
  8. jobs:
  9. nightly:
  10. name: Nightly build
  11. runs-on: ubuntu-latest
  12. env:
  13. PUBLISHER_NAME: ${{ secrets.PUBLISHER_NAME }}
  14. PUBLISHER_EMAIL: ${{ secrets.PUBLISHER_EMAIL }}
  15. PUBLISHER_TOKEN: ${{ secrets.PUBLISHER_TOKEN }}
  16. steps:
  17. - name: Checkout
  18. uses: actions/checkout@v3
  19. with:
  20. token: ${{ env.PUBLISHER_TOKEN }}
  21. - name: Update dot files for DBE
  22. id: update_dot_files
  23. run: rake update_dot_files
  24. - name: Check license
  25. id: check_license
  26. run: rake check_license
  27. - name: Check cache
  28. id: check_cache
  29. run: |
  30. last_run=$(date -d $(curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/urho3d/Urho3D/actions/workflows/2398550/runs 2>/dev/null |jq -r '.workflow_runs[0].created_at') '+%s')
  31. now=$(date '+%s')
  32. skip=$(( (now - last_run)/(60*60*24) < 7 ))
  33. echo "name=skip::$skip" >> $GITHUB_OUTPUT
  34. if: |
  35. steps.update_dot_files.outputs.commit == '0' &&
  36. steps.check_license.outputs.commit == '0'
  37. - name: Push
  38. run: git push
  39. if: |
  40. steps.update_dot_files.outputs.commit == '1' ||
  41. steps.check_license.outputs.commit == '1'
  42. - name: Dispatch
  43. uses: peter-evans/repository-dispatch@v2
  44. with:
  45. token: ${{ env.PUBLISHER_TOKEN }}
  46. repository: urho3d/Urho3D
  47. event-type: 'Warm DBE build cache'
  48. if: steps.check_cache.outputs.skip == '0'
  49. ...
  50. # vi: set ts=2 sw=2 expandtab: