Skip to content

Build package

Build package #4

name: Build package
on:
workflow_dispatch:
inputs:
can_publish:
description: "Publish built distributions"
type: boolean
required: true
default: true
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- uses: actions/setup-python@v5
with:
cache: pip
cache-dependency-path: pyproject.toml
python-version: "3.11"
- run: pip install build
- run: python -m build
- uses: actions/upload-artifact@v4
with:
name: dist-${{ runner.os }}
path: dist/
publish:
environment: release
runs-on: ubuntu-latest
permissions:
id-token: write
if: ${{ inputs.can_publish }}
needs:
- build
steps:
- uses: actions/download-artifact@v4
with:
pattern: dist-*
path: dist/
merge-multiple: true
- uses: pypa/[email protected]