Fix typo #2
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
name: Build | |
on: | |
push: | |
pull_request: | |
types: [opened, edited, synchronize] | |
jobs: | |
build: | |
name: Build wheels | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.11", "3.x"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install CPython | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install deps | |
run: | | |
pip install -U wheel setuptools pip Cython | |
pip install -Ur requirements.txt | |
- name: Build wheels | |
run: pip wheel -w ./wheelhouse/ . | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: artifact-wheels-${{ matrix.python-version }} | |
path: ./wheelhouse/twitchio-ext-oauth-relay*.whl | |
sdist: | |
name: Make source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: pipx run build --sdist | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: artifact-source-dist | |
path: "./**/dist/*.tar.gz" | |
lint: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.11", "3.x"] | |
name: "Type Coverage and Linting @ ${{ matrix.python-version }}" | |
steps: | |
- name: "Checkout Repository" | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: "Setup Python @ ${{ matrix.python-version }}" | |
id: setup-python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "${{ matrix.python-version }}" | |
cache: "pip" | |
- name: "Install Python deps @ ${{ matrix.python-version }}" | |
run: | | |
pip install -Ur requirements.txt | |
- name: "Run Pyright @ ${{ matrix.python-version }}" | |
uses: jakebailey/pyright-action@v2 | |
with: | |
version: 1.1.398 | |
annotate: ${{ matrix.python-version != '3.x' }} | |
warnings: false | |
- name: Lint with Ruff | |
uses: astral-sh/ruff-action@v3 | |
with: | |
version: "0.11.2" | |
- name: Check formatting with Ruff | |
run: | | |
ruff format --check | |
upload_pypi: | |
if: github.event_name == 'push' && github.ref_type == 'tag' | |
name: Publish built wheels to Pypi | |
runs-on: ubuntu-latest | |
environment: release | |
needs: [build, sdist] | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/download-artifact@v4 | |
- name: Copy artifacts to dist/ folder | |
run: | | |
find . -name 'artifact-*' -exec unzip '{}' \; | |
mkdir -p dist/ | |
find . -name '*.tar.gz' -exec mv '{}' dist/ \; | |
find . -name '*.whl' -exec mv '{}' dist/ \; | |
- uses: pypa/gh-action-pypi-publish@release/v1 | |
name: Publish to PyPI |