Skip to content

Commit

Permalink
Docs version & OpenGraph tweaks + version getter tweaks (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
geo-martino authored Feb 2, 2024
2 parents 8c210ee + 38103ff commit 92114d9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,20 +106,20 @@ jobs:
- name: ⚙️ Setup - Calculate and assign new version
run: |
export CURRENT_VERSION=$(curl -L https://pypi.python.org/pypi/musify/json | jq .info.version)
export CURRENT_MAJOR=$(echo ${CURRENT_VERSION//\"} | sed -r "s|^([0-9]+)\..*|\1|")
export CURRENT_MINOR=$(echo ${CURRENT_VERSION//\"} | sed -r "s|.*\.([0-9]+)\..*|\1|")
export CURRENT_PATCH=$(echo ${CURRENT_VERSION//\"} | sed -r "s|.*\.([0-9]+)$|\1|")
CURRENT_VERSION=$(curl -L https://pypi.python.org/pypi/musify/json | jq .info.version)
CURRENT_MAJOR=$(echo ${CURRENT_VERSION//\"} | sed -r "s|^([0-9]+)\..*|\1|")
CURRENT_MINOR=$(echo ${CURRENT_VERSION//\"} | sed -r "s|.*\.([0-9]+)\..*|\1|")
CURRENT_PATCH=$(echo ${CURRENT_VERSION//\"} | sed -r "s|.*\.([0-9]+)$|\1|")
echo Current version = $CURRENT_VERSION
echo Major=$CURRENT_MAJOR \| Minor=$CURRENT_MINOR \| Patch=$CURRENT_PATCH
if [[ $CURRENT_MAJOR -ne $(date -u "+%Y") || ${CURRENT_MINOR} -ne $(date -u "+%-m") ]]
then
echo Resetting patch number
export CURRENT_PATCH=-1
CURRENT_PATCH=-1
fi
export VERSION=$(date -u "+%Y").$(date -u "+%-m").$((CURRENT_PATCH + 1))
VERSION=$(date -u "+%Y").$(date -u "+%-m").$((CURRENT_PATCH + 1))
echo Assigning new version = $VERSION
hatch version $VERSION
Expand Down
6 changes: 6 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"sphinx.ext.inheritance_diagram",
"sphinx_autodoc_typehints",
"autodocsumm",
"sphinxext.opengraph",
]
autodoc_member_order = "bysource"
autodoc_default_options = {
Expand All @@ -48,6 +49,8 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_static_path = ["_static"]
html_title = project

html_theme = "sphinx_rtd_theme"
html_theme_options = dict(
collapse_navigation=False,
Expand All @@ -67,6 +70,9 @@
conf_py_path=f"/{basename(dirname(__file__))}/",
)

# -- OpenGraph configuration --------------------------------------------------
ogp_site_url = f"https://{PROGRAM_OWNER_NAME}.github.io/{PROGRAM_NAME.lower()}/"
ogp_use_first_image = False

# -- GraphViz configuration --------------------------------------------------
# https://graphviz.org/doc/info/attrs.html
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ docs = [
"graphviz~=0.20",
"sphinx-autodoc-typehints~=1.25",
"autodocsumm~=0.2",
"sphinxext-opengraph~=0.9",
]
dev = [
"musify[test,docs]",
Expand Down

0 comments on commit 92114d9

Please sign in to comment.