Rework GitHub workflows #6
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This workflow builds the Sphinx documentation, and in doing so - checks for errors in the documentation. | |
| name: build | |
| on: | |
| push: | |
| pull_request: | |
| types: [ opened, reopened, synchronize ] | |
| release: | |
| types: [ published ] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Setup Python 3.10 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.10" | |
| - name: Setup UV | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| - name: Install dependencies | |
| run: uv sync --extra docs | |
| - name: Build documentation | |
| run: | | |
| cd docs | |
| uv run sphinx-build -b html -j auto -a -n -T -W --keep-going . _build/html | |
| dist: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Setup Python 3.10 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.10" | |
| - name: Setup UV | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| - name: Install dependencies | |
| run: uv sync | |
| - name: Build distributions | |
| run: uv build | |
| dist-release: | |
| if: github.event_name == 'release' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/fortnite-api | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Setup Python 3.10 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.10" | |
| - name: Setup UV | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| - name: Install dependencies | |
| run: uv sync | |
| - name: Build distributions | |
| run: uv build | |
| - name: Publish distributions | |
| run: uv publish |