sync_class_ref.yml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. name: Sync Class Reference
  2. on:
  3. workflow_dispatch:
  4. # Scheduled updates only run on the default/master branch.
  5. schedule:
  6. # Run it at night (European time) every Saturday.
  7. # The offset is there to try and avoid the high load times.
  8. - cron: '15 3 * * 6'
  9. # Make sure jobs cannot overlap.
  10. concurrency:
  11. group: classref-sync-ci-master
  12. cancel-in-progress: true
  13. jobs:
  14. build:
  15. # Don't run scheduled runs on forks unless the CI_SYNC_CLASS_REF_CRON variable is set to 'true'.
  16. # Manual runs can still be triggered as normal.
  17. if: ${{ github.repository_owner == 'godotengine' || github.event_name != 'schedule' || vars.CI_SYNC_CLASS_REF_CRON == 'true' }}
  18. name: Update class reference files based on the engine revision
  19. runs-on: ubuntu-latest
  20. env:
  21. engine_rev: 'master'
  22. steps:
  23. - name: Checkout the documentation repository
  24. uses: actions/checkout@v4
  25. - name: Checkout the engine repository
  26. uses: actions/checkout@v4
  27. with:
  28. repository: 'godotengine/godot'
  29. # Use the appropriate branch for the documentation version.
  30. ref: ${{ env.engine_rev }}
  31. path: './.engine-src'
  32. - name: Store the engine revision
  33. id: 'engine'
  34. run: |
  35. cd ./.engine-src
  36. hash=$(git rev-parse HEAD)
  37. hash_short=$(git rev-parse --short HEAD)
  38. echo "Checked out godotengine/godot at $hash"
  39. echo "rev_hash=$hash" >> $GITHUB_OUTPUT
  40. echo "rev_hash_short=$hash_short" >> $GITHUB_OUTPUT
  41. - name: Remove old documentation
  42. run: |
  43. rm ./classes/class_*.rst
  44. - name: Build new documentation
  45. run: |
  46. ./.engine-src/doc/tools/make_rst.py --color -o ./classes -l en ./.engine-src/doc/classes ./.engine-src/modules ./.engine-src/platform
  47. - name: Submit a pull-request
  48. uses: peter-evans/create-pull-request@v7
  49. with:
  50. commit-message: 'classref: Sync with current ${{ env.engine_rev }} branch (${{ steps.engine.outputs.rev_hash_short }})'
  51. branch: 'classref/sync-${{ steps.engine.outputs.rev_hash_short }}'
  52. add-paths: './classes'
  53. delete-branch: true
  54. # Configure the commit author.
  55. author: 'Godot Organization <noreply@godotengine.org>'
  56. committer: 'Godot Organization <noreply@godotengine.org>'
  57. # Configure the pull-request.
  58. title: 'classref: Sync with current ${{ env.engine_rev }} branch (${{ steps.engine.outputs.rev_hash_short }})'
  59. body: 'Update Godot API online class reference to match the engine at https://github.com/godotengine/godot/commit/${{ steps.engine.outputs.rev_hash }} (`${{ env.engine_rev }}`).'
  60. labels: 'area:class reference,bug,enhancement'