|
1 | | -# name: Generate Docs |
2 | | - |
3 | | -# on: |
4 | | -# push: |
5 | | -# branches: [ stable ] |
6 | | -# workflow_dispatch: |
7 | | - |
8 | | -# jobs: |
9 | | -# docs: |
10 | | -# runs-on: ubuntu-latest |
11 | | -# steps: |
12 | | -# - uses: actions/checkout@v4 |
13 | | -# - name: Set up Python 3.9 |
14 | | -# uses: actions/setup-python@v5 |
15 | | -# with: |
16 | | -# python-version: 3.9 |
17 | | -# - name: Build |
18 | | -# run: | |
19 | | -# sudo apt-get install pandoc |
20 | | -# python -m pip install --upgrade pip |
21 | | -# pip install -e .[dev] |
22 | | -# make docs |
23 | | -# - name: Deploy |
24 | | -# uses: peaceiris/actions-gh-pages@v3 |
25 | | -# with: |
26 | | -# github_token: ${{secrets.GITHUB_TOKEN}} |
27 | | -# publish_dir: docs/_build/html |
28 | | -name: Release |
| 1 | +name: Generate Docs |
29 | 2 |
|
30 | 3 | on: |
31 | | - release: |
32 | | - types: [published] |
33 | | - |
| 4 | + push: |
| 5 | + branches: [ stable ] |
34 | 6 | workflow_dispatch: |
35 | | - inputs: |
36 | | - candidate: |
37 | | - description: 'If true, this creates a release candidate.' |
38 | | - required: true |
39 | | - type: boolean |
40 | | - default: true |
41 | | - test_pypi: |
42 | | - description: 'If true, this will push to the test pypi instead of regular.' |
43 | | - type: boolean |
44 | | - default: true |
45 | 7 |
|
46 | 8 | jobs: |
47 | | - release: |
| 9 | + docs: |
48 | 10 | runs-on: ubuntu-latest |
49 | 11 | steps: |
50 | | - - uses: actions/checkout@v4 |
51 | | - with: |
52 | | - ref: ${{ inputs.candidate && 'main-clone' || 'stable' }} |
53 | | - |
54 | | - - name: Set up Python |
55 | | - uses: actions/setup-python@v5 |
56 | | - with: |
57 | | - python-version: '3.13' |
58 | | - |
59 | | - - name: Install dependencies |
60 | | - run: | |
61 | | - python -m pip install --upgrade pip |
62 | | - python -m pip install .[dev] |
63 | | -
|
64 | | - - name: Create wheel |
65 | | - run: | |
66 | | - make dist |
67 | | -
|
68 | | - - name: Publish a Python distribution to PyPI |
69 | | - uses: pypa/gh-action-pypi-publish@release/v1 |
70 | | - with: |
71 | | - password: ${{ inputs.test_pypi && secrets.TEST_PYPI_API_TOKEN || secrets.PYPI_API_TOKEN }} |
72 | | - repository-url: ${{ inputs.test_pypi && 'https://test.pypi.org/legacy/' || 'https://upload.pypi.org/legacy/' }} |
73 | | - |
74 | | - - name: Bump version to next candidate |
75 | | - if: ${{ inputs.candidate && inputs.test_pypi }} |
76 | | - run: | |
77 | | - git config user.name "github-actions[bot]" |
78 | | - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" |
79 | | - make bumpversion-candidate |
80 | | - make git-push |
| 12 | + - uses: actions/checkout@v4 |
| 13 | + - name: Set up Python 3.9 |
| 14 | + uses: actions/setup-python@v5 |
| 15 | + with: |
| 16 | + python-version: 3.9 |
| 17 | + - name: Build |
| 18 | + run: | |
| 19 | + sudo apt-get install pandoc |
| 20 | + python -m pip install --upgrade pip |
| 21 | + pip install -e .[dev] |
| 22 | + make docs |
| 23 | + - name: Deploy |
| 24 | + uses: peaceiris/actions-gh-pages@v3 |
| 25 | + with: |
| 26 | + github_token: ${{secrets.GITHUB_TOKEN}} |
| 27 | + publish_dir: docs/_build/html |
0 commit comments