Skip to content

Merge pull request #221 from Starry-OvO/develop #83

Merge pull request #221 from Starry-OvO/develop

Merge pull request #221 from Starry-OvO/develop #83

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", "macos-13"]
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: pypa/[email protected]
- uses: actions/upload-artifact@v4
with:
name: artifact-wheels-${{ matrix.os }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: artifact-source
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: Merge artifacts
uses: actions/upload-artifact/merge@v4
with:
name: artifact
pattern: artifact-*
delete-merged: true
- name: Download artifacts
uses: actions/download-artifact@v4
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/