Start building Dash/Zeal docsets for docs (#1056)

This commit is contained in:
Hynek Schlawack 2022-11-25 08:30:34 +01:00 committed by GitHub
parent 287c6cedc2
commit 6c46bb19a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 57 additions and 1 deletions

39
.github/workflows/build-docset.yml vendored Normal file
View File

@ -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
.gitignore vendored
View File

@ -12,6 +12,8 @@
.vscode
build
dist
docs/_build/
docs/_build
htmlcov
tmp*
attrs.docset
attrs.tgz

BIN
docs/_static/docset-icon.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 B

BIN
docs/_static/docset-icon@2x.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

15
tox.ini
View File

@ -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