Files
gnwmanager/.github/workflows/deploy.yaml
2025-02-21 09:19:46 -05:00

57 lines
1.4 KiB
YAML

name: Build package and push to PyPi
on:
workflow_dispatch:
push:
tags:
- "v*.*.*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: arm-none-eabi-gcc GNU Arm Embedded Toolchain
uses: carlosperate/arm-none-eabi-gcc-action@v1.8.1
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Configure Poetry
run: |
poetry self add poetry-dynamic-versioning[plugin]
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Install project
run: poetry install --no-interaction
- name: Build stm32 firmwares
run: make -j4
- name: Build package
run: poetry build
- name: Publish package
if: github.event_name != 'workflow_dispatch'
run: poetry publish
- uses: actions/upload-artifact@v4
if: always()
with:
name: dist
path: dist/