sync_class_ref.yml 2.5 KB

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