on:
  push:
    tags:
      - "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10

name: PlatformIO Publish

env:
  PLATFORMIO_AUTH_TOKEN: ${{ secrets.PLATFORMIO_AUTH_TOKEN }}

jobs:
  build:
    runs-on: ubuntu-24.04
    steps:
      - name: Checkout code
        uses: actions/checkout@v6
      - name: Install Python
        uses: actions/setup-python@v6
        with:
          python-version: '3.12'
      - name: Install PlatformIO Core
        run: pip install --upgrade platformio
      - name: Switch to the development version
        run: pio upgrade --dev
      - name: Publish
        run: pio pkg publish --no-interactive --owner lvgl .
