v0.37.0 #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
name: Test and Publish | |
on: | |
push: | |
branches: | |
- testing | |
tags: | |
- 'v*-test' | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
workflow_dispatch: | |
permissions: | |
contents: read | |
id-token: write | |
jobs: | |
test: | |
name: Test | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ['3.11', '3.12', '3.13'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv and set Python version. | |
uses: astral-sh/setup-uv@v6 | |
with: | |
version: "latest" | |
python-version: ${{ matrix.python-version }} | |
- name: Install libusb on Linux. | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libusb-1.0-0-dev libudev-dev | |
- name: Run tests - ${{ matrix.python-version }} - ${{ matrix.os }} | |
run: | | |
uv run --all-extras pytest | |
publish: | |
name: Build & Publish | |
needs: test | |
if: | | |
github.ref_type == 'tag' && | |
startsWith(github.ref, 'refs/tags/v') && | |
!endsWith(github.ref, '-test') && | |
success() | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/project/busylight-for-humans | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv and set Python version. | |
uses: astral-sh/setup-uv@v6 | |
with: | |
version: "latest" | |
python-version: 3.13 | |
- name: Build package. | |
run: | | |
uv build | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
# - name: Create GitHub Release | |
# uses: actions/create-release@v1 | |
# with: | |
# tag_name: ${{ github.ref_name }} | |
# release_name: Release ${{ github.ref_name }} | |
# generate_release_notes: true | |
# draft: false | |
# prerelease: false | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |