Skip to content

build

build #7

Workflow file for this run

name: build
# Use this workflow to manually trigger a build for testing purposes.
# Download it from artifacts to test installation, or upload directly to PyPI.
on:
workflow_dispatch:
inputs:
release-pypi:
required: true
type: boolean
jobs:
build_sdist:
name: Build sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Optional, use if you use setuptools_scm
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
release-pypi:
needs: [build_sdist]
runs-on: ubuntu-latest
if: github.event.inputs.release-pypi == 'true'
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}