Skip to content

Commit

Permalink
Start building Dash/Zeal docsets for docs (#1056)
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Nov 25, 2022
1 parent 287c6ce commit 6c46bb1
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 1 deletion.
39 changes: 39 additions & 0 deletions .github/workflows/build-docset.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: Build docset

on:
push:
tags: ["*"]
workflow_dispatch:

env:
PIP_DISABLE_PIP_VERSION_CHECK: 1
PIP_NO_PYTHON_VERSION_WARNING: 1

permissions: # added using https://github.com/step-security/secure-workflows
contents: read

jobs:
docset:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@v1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

- uses: actions/checkout@v3
with:
fetch-depth: 0 # get correct version once we switch to hatch-vcs
- uses: actions/setup-python@v4
with:
python-version: "3.11"

- run: pip install tox

- run: tox -e docset

- uses: actions/upload-artifact@v3
with:
name: docset
path: attrs.tgz
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
.vscode
build
dist
docs/_build/
docs/_build
htmlcov
tmp*
attrs.docset
attrs.tgz
Binary file added docs/_static/docset-icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/docset-icon@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,18 @@ commands =
nodeenv --prebuilt --node=lts --force {envdir}
npm install -g --no-package-lock --no-save pyright
pytest tests/test_pyright.py -vv


[testenv:docset]
deps = doc2dash
extras = docs
allowlist_externals =
rm
cp
tar
commands =
rm -rf attrs.docset attrs.tgz docs/_build
sphinx-build -n -T -W -b html -d {envtmpdir}/doctrees docs docs/_build/html
doc2dash --index-page index.html --icon docs/_static/docset-icon.png --online-redirect-url https://www.attrs.org/en/latest/ docs/_build/html
cp docs/_static/docset-icon@2x.png attrs.docset/icon@2x.png
tar --exclude='.DS_Store' -cvzf attrs.tgz attrs.docset

0 comments on commit 6c46bb1

Please sign in to comment.