scripting.yml 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. # SuperTux
  2. # Copyright (C) 2023 Vankata453
  3. #
  4. # This program is free software; you can redistribute it and/or
  5. # modify it under the terms of the GNU General Public License
  6. # as published by the Free Software Foundation; either version 3
  7. # of the License, or (at your option) any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program; if not, write to the Free Software
  16. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17. name: Scripting
  18. on:
  19. push:
  20. branches: [ "master" ]
  21. paths:
  22. - src/scripting/*.hpp
  23. workflow_dispatch:
  24. jobs:
  25. scripting-update:
  26. runs-on: ubuntu-latest
  27. steps:
  28. - name: Checkout the repository
  29. uses: actions/checkout@v4
  30. with:
  31. fetch-depth: 1
  32. - name: Checkout the wiki repository
  33. uses: actions/checkout@v4
  34. with:
  35. repository: SuperTux/wiki
  36. path: wiki
  37. fetch-depth: 1
  38. - name: Install packages
  39. run: |
  40. sudo apt-get update
  41. sudo apt-get install -y \
  42. cmake \
  43. build-essential \
  44. g++-9 \
  45. libc++-dev \
  46. libtinyxml2-dev \
  47. doxygen
  48. - name: Build scripting reference generator
  49. working-directory: tools/scripting_docs_gen
  50. run: |
  51. cmake --version
  52. mkdir build
  53. cd build
  54. cmake .. -DBUILD_SCRIPTING_DOCUMENTATION=ON
  55. make
  56. - name: Generate scripting reference
  57. working-directory: tools/scripting_docs_gen/build
  58. run: |
  59. doxygen docs/scripting/Doxyfile
  60. rm ../../../wiki/Scripting*.md
  61. ./ScriptingDocsGen --dir docs/scripting/doxygen/xml \
  62. --home ../../../wiki/templates/ScriptingHome.md \
  63. --page ../../../wiki/templates/ScriptingPage.md \
  64. --output ../../../wiki
  65. - name: Install SSH key
  66. uses: shimataro/ssh-key-action@v2
  67. with:
  68. key: ${{ secrets.wiki_repo_key }}
  69. known_hosts: ${{ secrets.wiki_repo_hosts }}
  70. - name: Push changes to wiki
  71. working-directory: wiki
  72. run: |
  73. git --version
  74. git status
  75. git config --global user.email "supertux-bot"
  76. git config --global user.name "SuperTux Bot"
  77. git add .
  78. git commit -m "Update scripting reference (SuperTux/supertux@${{ github.sha }})"
  79. git push git@github.com:SuperTux/wiki.git HEAD:master