|
1 | | -name: Publish |
| 1 | +name: Build doc, release and publish |
2 | 2 |
|
3 | | -on: |
4 | | - push: |
5 | | - tags: |
6 | | - - '*' |
| 3 | +on: [push] |
7 | 4 |
|
8 | 5 | jobs: |
| 6 | + build_doc: |
| 7 | + runs-on: ubuntu-latest |
| 8 | + steps: |
| 9 | + - uses: actions/checkout@v3 |
| 10 | + - uses: actions/setup-python@v3 |
| 11 | + with: |
| 12 | + python-version: 3.7 |
| 13 | + - name: Install dependencies |
| 14 | + run: | |
| 15 | + python -m pip install --upgrade pip |
| 16 | + scripts/ci_install_pyo3_builds.sh |
| 17 | + pip install -r docs/requirements.txt |
| 18 | + - name: Build package |
| 19 | + run: | |
| 20 | + python scripts/extract_lib_types.py |
| 21 | + cd docs |
| 22 | + make html |
| 23 | + cd _build |
| 24 | + zip -r ../../Documentation.zip html/ |
| 25 | + - uses: actions/upload-artifact@v3 |
| 26 | + with: |
| 27 | + name: html_doc |
| 28 | + path: Documentation.zip |
| 29 | + retention-days: 1 |
| 30 | + |
9 | 31 | release: |
| 32 | + needs: build_doc |
10 | 33 | runs-on: ubuntu-latest |
11 | 34 | steps: |
12 | 35 | - uses: actions/checkout@v3 |
13 | | - - name: Release |
| 36 | + - name: Download artifact |
| 37 | + uses: actions/download-artifact@v3 |
| 38 | + with: |
| 39 | + name: html_doc |
| 40 | + path: . |
| 41 | + - name: Release on tags, attach asset on release |
| 42 | + if: startsWith(github.ref, 'refs/tags/') |
14 | 43 | uses: softprops/action-gh-release@v1 |
| 44 | + with: |
| 45 | + files: Documentation.zip |
15 | 46 |
|
16 | 47 | publish: |
17 | 48 | runs-on: ubuntu-latest |
|
27 | 58 | pip install twine |
28 | 59 | python -m build |
29 | 60 | - name: Upload to Pypi |
| 61 | + if: startsWith(github.ref, 'refs/tags/') |
30 | 62 | run: twine upload -u "${PYPI_USERNAME}" -p "${PYPI_PASSWORD}" dist/cloudproof_py*.whl |
31 | 63 | env: |
32 | 64 | PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }} |
33 | 65 | PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} |
34 | | - |
35 | | - docs: |
36 | | - runs-on: ubuntu-latest |
37 | | - steps: |
38 | | - - uses: actions/checkout@v3 |
39 | | - - uses: actions/setup-python@v3 |
40 | | - with: |
41 | | - python-version: 3.7 |
42 | | - - name: Install dependencies |
43 | | - run: | |
44 | | - python -m pip install --upgrade pip |
45 | | - scripts/ci_install_pyo3_builds.sh |
46 | | - pip install -r docs/requirements.txt |
47 | | - - name: Build package |
48 | | - run: | |
49 | | - python scripts/extract_lib_types.py |
50 | | - cd docs && make html |
51 | | - - uses: actions/upload-artifact@v3 |
52 | | - with: |
53 | | - name: html_doc |
54 | | - path: docs/_build/html |
55 | | - retention-days: 60 |
|
0 commit comments