Switch from pywin32 to ctype (#5) #57
This file contains 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: Run Tests | |
on: | |
push: | |
branches: | |
- "master" | |
tags: | |
- "v*.*.*" | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
tests: | |
name: Python ${{ matrix.python-version }} • ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
python-version: [3.9, "3.10", "3.11", "3.12", "3.13"] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
exclude: | |
- os: macos-latest | |
python-version: 3.9 | |
- os: windows-latest | |
python-version: 3.9 | |
- os: macos-latest | |
python-version: 3.10 | |
- os: windows-latest | |
python-version: 3.10 | |
- os: macos-latest | |
python-version: 3.11 | |
- os: windows-latest | |
python-version: 3.11 | |
- os: macos-latest | |
python-version: 3.12 | |
- os: windows-latest | |
python-version: 3.12 | |
steps: | |
- run: echo ${{github.ref}} | |
- uses: actions/checkout@v4 | |
- name: Set up FFmpeg | |
uses: FedericoCarboni/[email protected] | |
with: | |
architecture: x64 | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: ${{ matrix.arch }} | |
- name: Setup Python dependencies | |
run: | | |
python -m pip install -U pip | |
pip install -U -r tests/requirements.txt pytest-github-actions-annotate-failures | |
- name: Install namedpipe package | |
run: pip install -q . | |
- name: Run tests | |
run: pytest -vv | |
release: | |
name: Distribution | |
permissions: write-all | |
runs-on: ubuntu-latest | |
needs: tests | |
if: startsWith(github.ref, 'refs/tags') | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" # Version range or exact version of a Python version to use, using SemVer's version range syntax | |
- name: Setup Python dependencies | |
run: | | |
python -m pip install -U pip setuptools | |
pip install -U build | |
- name: Build a binary wheel and a source tarball | |
run: python -m build --sdist --wheel --outdir dist/ . | |
- name: add python distribution files to release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: dist/* | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: ./dist | |
pypi-publish: | |
name: Upload release to PyPI | |
needs: release | |
runs-on: ubuntu-latest | |
# environment: | |
# name: pypi | |
# url: https://pypi.org/p/<your-pypi-project-name> | |
permissions: | |
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | |
steps: | |
# retrieve your distributions to artifact folder | |
- uses: actions/download-artifact@v4 | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
packages-dir: artifact/ | |
skip-existing: true |