docs.yml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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: Setup Environment
  16. id: setup
  17. run: |
  18. echo "commitHash=$(git describe --exact-match --tags 2> /dev/null || git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
  19. - name: Bump Version Number
  20. shell: bash
  21. if: github.event_name == 'push'
  22. run: |
  23. VERTEST="\#define\sLIBOBS_API_\w+_VER\s([0-9]{1,2})"
  24. VER=""
  25. MAJOR=""
  26. while IFS= read -r l
  27. do
  28. if [[ $l =~ $VERTEST ]]; then
  29. if [[ $VER = '' ]]; then MAJOR="${BASH_REMATCH[1]}"; else VER+="."; fi
  30. VER+="${BASH_REMATCH[1]}"
  31. fi
  32. done < "libobs/obs-config.h"
  33. SVER="version = '([0-9\.]+)'"
  34. RVER="version = '$VER'"
  35. SREL="release = '([0-9\.]+)'"
  36. RREL="release = '$VER'"
  37. SCOPY="copyright = '([A-Za-z0-9, ]+)'"
  38. RCOPY="copyright = '2017-$(date +"%Y"), Hugh Bailey'"
  39. sed -i -E -e "s/${SVER}/${RVER}/g" -e "s/${SREL}/${RREL}/g" -e "s/${SCOPY}/${RCOPY}/g" docs/sphinx/conf.py
  40. - uses: totaldebug/[email protected]
  41. with:
  42. sphinx_src: 'docs/sphinx'
  43. build_only: True
  44. target_branch: 'master'
  45. target_path: '../home/_build'
  46. pre_build_commands: 'pip install -Iv sphinx==5.1.1'
  47. - uses: actions/upload-artifact@v3
  48. with:
  49. name: 'OBS Studio Docs ${{ steps.setup.outputs.commitHash }}'
  50. path: |
  51. ${{ runner.temp }}/_github_home/_build
  52. !${{ runner.temp }}/_github_home/_build/.doctrees