docs.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. name: Generate Documentation
  2. on:
  3. push:
  4. paths-ignore:
  5. - "cmake/**"
  6. pull_request:
  7. paths:
  8. - "docs/sphinx/**"
  9. jobs:
  10. docs:
  11. runs-on: ubuntu-latest
  12. steps:
  13. - name: Checkout
  14. uses: actions/checkout@v3
  15. - name: Bump Version Number
  16. shell: bash
  17. if: github.event_name == 'push'
  18. run: |
  19. VERTEST="\#define\sLIBOBS_API_\w+_VER\s([0-9]{1,2})"
  20. VER=""
  21. MAJOR=""
  22. while IFS= read -r l
  23. do
  24. if [[ $l =~ $VERTEST ]]; then
  25. if [[ $VER = '' ]]; then MAJOR="${BASH_REMATCH[1]}"; else VER+="."; fi
  26. VER+="${BASH_REMATCH[1]}"
  27. fi
  28. done < "libobs/obs-config.h"
  29. SVER="version = '([0-9\.]+)'"
  30. RVER="version = '$VER'"
  31. SREL="release = '([0-9\.]+)'"
  32. RREL="release = '$VER'"
  33. SCOPY="copyright = '([A-Za-z0-9, ]+)'"
  34. RCOPY="copyright = '2017-$(date +"%Y"), Hugh Bailey'"
  35. sed -i -E -e "s/${SVER}/${RVER}/g" -e "s/${SREL}/${RREL}/g" -e "s/${SCOPY}/${RCOPY}/g" docs/sphinx/conf.py
  36. - uses: totaldebug/[email protected]
  37. with:
  38. sphinx_src: 'docs/sphinx'
  39. build_only: True
  40. target_branch: 'master'
  41. target_path: '../home/_build'
  42. pre_build_commands: 'pip install -Iv sphinx==5.1.1'
  43. - uses: actions/upload-artifact@v3
  44. with:
  45. name: OBS Studio Documentation (HTML)
  46. path: |
  47. ${{ runner.temp }}/_github_home/_build
  48. !${{ runner.temp }}/_github_home/_build/.doctrees