Skip to content
name: Build and Publish Hue Entertainment PyKit
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.10", "3.11", "3.12", "3.12.1", "3.12.2", "3.12.3", "3.12.4", "3.12.5", "3.12.6", "3.12.7" ]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build wheel twine
- name: Add 'src' to PYTHONPATH
run: echo "PYTHONPATH=${{ github.workspace }}/src" >> $GITHUB_ENV
- name: Build package
run: python -m build --wheel
- name: Test package
run: twine check dist/*
- name: Publish to PyPI
if: github.event_name == 'release' && matrix.python-version == '3.10'
run: twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}