sync_class_ref.yml 2.2 KB

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