name: Build and Publish to PyPI on: workflow_dispatch: release: types: [published] jobs: build-and-publish: runs-on: ubuntu-latest permissions: contents: read id-token: write # Required for trusted publishing to PyPI steps: - name: Checkout code uses: actions/checkout@v4 with: persist-credentials: false - name: Set up Node.js uses: actions/setup-node@v4 with: node-version: '22' - name: Build frontend run: | cd web npm install npm run build - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.10' - name: Install build dependencies run: | python -m pip install --upgrade pip pip install build twine - name: Build package run: | python -m build - name: Check package run: | twine check dist/* - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: skip-existing: true