obs-websocket/CI/generate-docs.sh

37 lines
891 B
Bash
Raw Normal View History

2021-03-08 11:56:43 +00:00
#!/bin/bash
set -e
echo "-- Generating documentation."
echo "-- Node version: $(node -v)"
echo "-- NPM version: $(npm -v)"
docs: Overhaul documentation (#863) More docs-related commits will follow, but this needs to be merged in order to continue with other development. * Docs: Overhaul docs generator (beginning) * docs: Rename comments file * docs: Move comments gitignore * docs: Initial request documentation * docs: Improvements to comment processing * docs: More improvements * docs: Add enum functionality for protocol.json * WebSocketServer: Document enums * RequestHandler: Document RequestStatus enum * Base: Move ObsWebSocketRequestBatchExecutionType to its own file Moves it to its own file, renaming it to `RequestBatchExecutionType`. Changes the RPC to use integer values for selecting execution type instead of strings. * docs: Update introduction header Removes the enum section, and documents RequestBatchExecutionType. * WebSocketCloseCode: Shuffle a bit * Base: Use `field` instead of `key` or `parameter` in most places * RequestStatus: Mild shuffle It was really bothering me that OutputPaused and OutputNotPaused had to be separated, so we're breaking it while we're breaking other stuff. * docs: Delete old files They may be added back in some form, but for now I'm getting them out of the way. * docs: Add enum identifier value Forgot to add this before, oops * docs: Document more enums * docs: Add basic protocol.md generator * docs: More work on MD generator * docs: MD generator should be finished now * docs: More fixes * docs: More fixes * docs: More tweaks + add readme * docs: Update readme and add inputs docs * docs: More documentation
2021-12-11 05:38:18 +00:00
echo "-- Python3 version: $(python3 -V)"
2021-03-08 11:56:43 +00:00
git fetch origin
git checkout ${CHECKOUT_REF/refs\/heads\//}
cd docs
docs: Overhaul documentation (#863) More docs-related commits will follow, but this needs to be merged in order to continue with other development. * Docs: Overhaul docs generator (beginning) * docs: Rename comments file * docs: Move comments gitignore * docs: Initial request documentation * docs: Improvements to comment processing * docs: More improvements * docs: Add enum functionality for protocol.json * WebSocketServer: Document enums * RequestHandler: Document RequestStatus enum * Base: Move ObsWebSocketRequestBatchExecutionType to its own file Moves it to its own file, renaming it to `RequestBatchExecutionType`. Changes the RPC to use integer values for selecting execution type instead of strings. * docs: Update introduction header Removes the enum section, and documents RequestBatchExecutionType. * WebSocketCloseCode: Shuffle a bit * Base: Use `field` instead of `key` or `parameter` in most places * RequestStatus: Mild shuffle It was really bothering me that OutputPaused and OutputNotPaused had to be separated, so we're breaking it while we're breaking other stuff. * docs: Delete old files They may be added back in some form, but for now I'm getting them out of the way. * docs: Add enum identifier value Forgot to add this before, oops * docs: Document more enums * docs: Add basic protocol.md generator * docs: More work on MD generator * docs: MD generator should be finished now * docs: More fixes * docs: More fixes * docs: More tweaks + add readme * docs: Update readme and add inputs docs * docs: More documentation
2021-12-11 05:38:18 +00:00
bash build_docs.sh
2021-03-08 11:56:43 +00:00
echo "-- Documentation successfully generated."
if git diff --quiet; then
echo "-- No documentation changes to commit."
exit 0
fi
# Exit if we aren't a CI run to prevent messing with the current git config
if [ -z "${IS_CI}" ]; then
exit 0
fi
2021-03-08 11:56:43 +00:00
REMOTE_URL="$(git config remote.origin.url)"
TARGET_REPO=${REMOTE_URL/https:\/\/github.com\//github.com/}
GITHUB_REPO=https://${GH_TOKEN:-git}@${TARGET_REPO}
2021-04-27 00:35:19 +00:00
git config user.name "Github Actions"
2021-03-08 11:56:43 +00:00
git config user.email "$COMMIT_AUTHOR_EMAIL"
git add ./generated
git pull
2021-04-27 00:35:19 +00:00
git commit -m "docs(ci): Update generated docs - $(git rev-parse --short HEAD) [skip ci]"
git push -q $GITHUB_REPO