-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (61 loc) · 1.77 KB
/
publish.yml
File metadata and controls
65 lines (61 loc) · 1.77 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
name: Build doc, release and publish
on: [push]
jobs:
build_doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
scripts/ci_install_pyo3_builds.sh
pip install -r docs/requirements.txt
- name: Build package
run: |
python scripts/extract_lib_types.py
cd docs
make html
cd _build
zip -r ../../Documentation.zip html/
- uses: actions/upload-artifact@v3
with:
name: html_doc
path: Documentation.zip
retention-days: 1
release:
needs: build_doc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: html_doc
path: .
- name: Release on tags, attach asset on release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: Documentation.zip
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: 3.7
- name: Install dependencies and build
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
python -m build
- name: Publish package to PyPI
if: startsWith(github.ref, 'refs/tags/')
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://upload.pypi.org/legacy/
print-hash: true
password: ${{ secrets.PYPI_API_TOKEN }}