Skip to content

Build Python Package #4

Build Python Package

Build Python Package #4

Workflow file for this run

name: Build Python Package
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch: # 手动触发按钮
jobs:
build:
name: Build on ${{ matrix.os }} with Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build setuptools wheel pybind11
- name: Build the package
run: |
python -m build
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.os }}-py${{ matrix.python-version }}
path: dist/*