-
Notifications
You must be signed in to change notification settings - Fork 27
71 lines (56 loc) · 1.82 KB
/
Copy pathpython-publish.yml
File metadata and controls
71 lines (56 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Upload Python Package and Deploy Docs
on:
release:
types: [published]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Fetch all history for all tags and branches
run: git fetch --prune --unshallow
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.13'
- name: Install setuptools_scm and build tools
run: |
python -m pip install --upgrade pip
pip install build setuptools_scm
- name: Build package
env:
SETUPTOOLS_SCM_LOCAL_SCHEME: no-local-version
run: python -m build
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
docs:
runs-on: ubuntu-latest
needs: deploy # Wait for package to be published
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
# - name: Install documentation dependencies
# run: |
# pip install .[dev]
# pip install sphinx myst-parser furo
# - name: Extract version from _version.py
# id: get_version
# run: |
# version=$(grep -oP "__version__ = '\K[^']+" ./pyalarmdotcomajax/_version.py)
# echo "version=$version" >> "$GITHUB_OUTPUT"
# - name: Build documentation
# run: |
# sphinx-build -b html docs/ docs/_build/html \
# -D version="${{ steps.get_version.outputs.version }}" \
# -D release="${{ steps.get_version.outputs.version }}"
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build/html