Co-authored-by: StepSecurity Bot <bot@stepsecurity.io> Co-authored-by: niStee <52573120+niStee@users.noreply.github.comclear> Co-authored-by: GideonBear <87426140+GideonBear@users.noreply.github.com>
111 lines
3.0 KiB
YAML
111 lines
3.0 KiB
YAML
name: Update PyPi
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
linux:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
target: [x86_64, x86, aarch64]
|
|
steps:
|
|
- uses: actions/checkout@v4.2.2
|
|
- name: Build wheels
|
|
uses: PyO3/maturin-action@e10f6c464b90acceb5f640d31beda6d586ba7b4a # v1.49.3
|
|
with:
|
|
target: ${{ matrix.target }}
|
|
args: --release --out dist
|
|
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
manylinux: auto
|
|
- name: Upload wheels
|
|
uses: actions/upload-artifact@v4.6.2
|
|
with:
|
|
name: wheels-linux-${{ matrix.target }}
|
|
path: dist
|
|
|
|
windows:
|
|
runs-on: windows-latest
|
|
strategy:
|
|
matrix:
|
|
target: [x64, x86]
|
|
steps:
|
|
- uses: actions/checkout@v4.2.2
|
|
- name: Build wheels
|
|
uses: PyO3/maturin-action@e10f6c464b90acceb5f640d31beda6d586ba7b4a # v1.49.3
|
|
with:
|
|
target: ${{ matrix.target }}
|
|
args: --release --out dist
|
|
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
- name: Upload wheels
|
|
uses: actions/upload-artifact@v4.6.2
|
|
with:
|
|
name: wheels-windows-${{ matrix.target }}
|
|
path: dist
|
|
|
|
macos:
|
|
runs-on: macos-latest
|
|
strategy:
|
|
matrix:
|
|
target: [x86_64, aarch64]
|
|
steps:
|
|
- uses: actions/checkout@v4.2.2
|
|
- name: Build wheels
|
|
uses: PyO3/maturin-action@e10f6c464b90acceb5f640d31beda6d586ba7b4a # v1.49.3
|
|
with:
|
|
target: ${{ matrix.target }}
|
|
args: --release --out dist
|
|
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
- name: Upload wheels
|
|
uses: actions/upload-artifact@v4.6.2
|
|
with:
|
|
name: wheels-macos-${{ matrix.target }}
|
|
path: dist
|
|
|
|
sdist:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4.2.2
|
|
- name: Build sdist
|
|
uses: PyO3/maturin-action@e10f6c464b90acceb5f640d31beda6d586ba7b4a # v1.49.3
|
|
with:
|
|
command: sdist
|
|
args: --out dist
|
|
- name: Upload sdist
|
|
uses: actions/upload-artifact@v4.6.2
|
|
with:
|
|
name: wheels-sdist
|
|
path: dist
|
|
|
|
release:
|
|
name: Release
|
|
runs-on: ubuntu-latest
|
|
needs: [linux, windows, macos, sdist]
|
|
permissions:
|
|
# Use to sign the release artifacts
|
|
id-token: write
|
|
# Used to upload release artifacts
|
|
contents: write
|
|
# Used to generate artifact attestation
|
|
attestations: write
|
|
steps:
|
|
- uses: actions/download-artifact@v4.3.0
|
|
|
|
- name: Generate artifact attestation
|
|
uses: actions/attest-build-provenance@v2.4.0
|
|
with:
|
|
subject-path: 'wheels-*/*'
|
|
|
|
- name: Publish to PyPI
|
|
uses: PyO3/maturin-action@e10f6c464b90acceb5f640d31beda6d586ba7b4a # v1.49.3
|
|
env:
|
|
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
|
|
with:
|
|
command: upload
|
|
args: --non-interactive --skip-existing wheels-*/*
|