Skip to content

Commit

Permalink
Add self-publishing docs workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Creech committed Feb 29, 2024
1 parent e343edf commit 363c2fe
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: docs
on:
push:
branches:
- freshen # TODO, move to main when done
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v5
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install hatch hatch-mkdocs
- run: hatch -vv run docs:gh-deploy --force
5 changes: 1 addition & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ build-backend = "hatchling.build"

# TODOs:
# make sure alpine and mac and win32 build
# make sure `hatch run docs:gh-deploy` works
# fix up re-commit.yaml
# check code for more TODOs

Expand Down Expand Up @@ -63,9 +62,7 @@ dependencies = [
path = "mkdocs.yml"

[tool.hatch.envs.docs]
# docs require the project to be installed, so that mkdocstrings can infer the
# API docs by reflecting on the Python module:
detached = false
detached = true

dependencies = [
"mdformat",
Expand Down
2 changes: 1 addition & 1 deletion src/py_mini_racer/py_mini_racer.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def _get_lib_path(name):

# In python 3 the extension file name depends on the python version
EXTENSION_PATH = _get_lib_path("mini_racer")
EXTENSION_NAME = basename(EXTENSION_PATH) if EXTENSION_PATH is not None else None
EXTENSION_NAME = None if EXTENSION_PATH is None else basename(EXTENSION_PATH)


class MiniRacerBaseException(Exception): # noqa: N818
Expand Down

0 comments on commit 363c2fe

Please sign in to comment.