52 lines
1.2 KiB
YAML
52 lines
1.2 KiB
YAML
name: CI
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
tags: ['v*']
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
linux:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
target: [x86_64, aarch64]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.10'
|
|
- name: Build wheels
|
|
uses: PyO3/maturin-action@v1
|
|
with:
|
|
target: ${{ matrix.target }}
|
|
args: --release --out dist --find-interpreter
|
|
sccache: 'true'
|
|
manylinux: auto
|
|
- name: Upload wheels
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: wheels-linux-${{ matrix.target }}
|
|
path: dist
|
|
|
|
release:
|
|
name: Release
|
|
runs-on: ubuntu-latest
|
|
if: "startsWith(github.ref, 'refs/tags/v')"
|
|
needs: [linux]
|
|
permissions:
|
|
id-token: write # 必须开启,用于 Trusted Publishing
|
|
steps:
|
|
- uses: actions/download-artifact@v4
|
|
- name: Publish to PyPI
|
|
uses: PyO3/maturin-action@v1
|
|
with:
|
|
command: upload
|
|
args: --non-interactive --skip-existing wheels-*/* |