Build Wheels & Release #20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Wheels & Release | |
on: | |
workflow_dispatch: | |
inputs: | |
pypi: | |
description: 'Upload wheels to PyPI? 1 = yes, 0 = no' | |
default: '0' | |
required: true | |
type: string | |
permissions: | |
contents: write | |
jobs: | |
build_sdist_and_wheel: | |
name: Build source distribution and pure-Python wheel | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- id: build | |
uses: OpenAstronomy/build-python-dist@v1 | |
with: | |
pure_python_wheel: true | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: 'sdist' | |
path: ./dist/* | |
publish-sdist-to-pypi: | |
name: Publish Python distribution to PyPI | |
if: inputs.pypi == '1' | |
needs: build_sdist_and_wheel | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/p/llm-quantkit | |
permissions: | |
id-token: write # IMPORTANT: mandatory for trusted publishing | |
steps: | |
- name: Download the sdist | |
uses: actions/download-artifact@v3 | |
with: | |
name: sdist | |
path: dist/ | |
- name: Publish distribution to PyPI | |
uses: pypa/[email protected] | |