Skip to content

Merge pull request #147 from Starry-OvO/develop #50

Merge pull request #147 from Starry-OvO/develop

Merge pull request #147 from Starry-OvO/develop #50

Workflow file for this run

name: Publish
on:
push:
tags:
- "*"
workflow_dispatch:
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
steps:
- uses: actions/checkout@v3
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-* pp38-* pp39-* pp310-*"
CIBW_SKIP: "*-win32 *_i686 *_s390x *_ppc64le"
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
publish:
name: Publish
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment:
name: pypi
permissions:
id-token: write
steps:
- name: Download distributions
uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- name: Publish to PyPI
if: ${{ github.event_name == 'push' }}
uses: pypa/gh-action-pypi-publish@release/v1
- name: Publish to TestPyPI
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/