sync_class_ref.yml 2.6 KB

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