Skip to content

Workflow file for this run

name: Python-Build
on:
push:
tags: [ "v*" ]
branches: [ "dev", "test/*"]
pull_request:
branches: [ "main" ]
concurrency:
group: Python-Build-${{ github.ref }}
cancel-in-progress: true
jobs:
build-wheel:
name: build-wheel-${{matrix.config.name}}
runs-on: ${{matrix.config.os}}
strategy:
matrix:
config:
- {name: macos, os: macos-13}
- {name: linux, os: ubuntu-latest}
- {name: windows, os: windows-latest}
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Create and activate virtual environment
run: |
python -m venv venv
echo "PATH=$(pwd)/venv/bin:$PATH" >> $GITHUB_ENV
- name: Install cibuildwheel
run: |
pip install cibuildwheel
- name: Build wheel
run: python -m cibuildwheel --output-dir wheelhouse
- name: Upload k230_flash-python Build Artifact
uses: actions/upload-artifact@v4
with:
name: k230_flash-python-${{matrix.config.name}}
path: ${{github.workspace}}/wheelhouse
if-no-files-found: error
pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs: ["build-wheel"]
environment:
name: pypi
url: https://pypi.org/p/k230_flash
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: ${{github.workspace}}/dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1