sync_class_ref.yml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. name: Update class reference files based on the engine revision
  16. runs-on: ubuntu-latest
  17. env:
  18. engine_rev: 'master'
  19. steps:
  20. - name: Checkout the documentation repository
  21. uses: actions/checkout@v4
  22. - name: Checkout the engine repository
  23. uses: actions/checkout@v4
  24. with:
  25. repository: 'godotengine/godot'
  26. # Use the appropriate branch for the documentation version.
  27. ref: ${{ env.engine_rev }}
  28. path: './.engine-src'
  29. - name: Store the engine revision
  30. id: 'engine'
  31. run: |
  32. cd ./.engine-src
  33. hash=$(git rev-parse HEAD)
  34. hash_short=$(git rev-parse --short HEAD)
  35. echo "Checked out godotengine/godot at $hash"
  36. echo "rev_hash=$hash" >> $GITHUB_OUTPUT
  37. echo "rev_hash_short=$hash_short" >> $GITHUB_OUTPUT
  38. - name: Remove old documentation
  39. run: |
  40. rm ./classes/class_*.rst
  41. - name: Build new documentation
  42. run: |
  43. ./.engine-src/doc/tools/make_rst.py --color -o ./classes -l en ./.engine-src/doc/classes ./.engine-src/modules ./.engine-src/platform
  44. - name: Submit a pull-request
  45. uses: peter-evans/create-pull-request@v7
  46. with:
  47. commit-message: 'classref: Sync with current ${{ env.engine_rev }} branch (${{ steps.engine.outputs.rev_hash_short }})'
  48. branch: 'classref/sync-${{ steps.engine.outputs.rev_hash_short }}'
  49. add-paths: './classes'
  50. delete-branch: true
  51. # Configure the commit author.
  52. author: 'Godot Organization <[email protected]>'
  53. committer: 'Godot Organization <[email protected]>'
  54. # Configure the pull-request.
  55. title: 'classref: Sync with current ${{ env.engine_rev }} branch (${{ steps.engine.outputs.rev_hash_short }})'
  56. 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 }}`).'
  57. labels: 'area:class reference,bug,enhancement'