Skip to content

Build and Publish Wheel to GitHub Pages #4

Build and Publish Wheel to GitHub Pages

Build and Publish Wheel to GitHub Pages #4

Workflow file for this run

name: Build Wheel
on:
workflow_dispatch:
inputs:
python_version:
description: 'Python version to use for the build'
required: true
default: '3.10'
branch:
description: 'Branch to checkout'
required: true
default: 'main'
jobs:
build_wheel:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ github.event.inputs.python_version }}
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build wheel
run: python -m build --wheel
- name: Get wheel filename
id: get_filename
run: |
whl_file=$(ls dist/*.whl)
whl_name=$(basename "$whl_file")
echo "whl_file=$whl_file" >> $GITHUB_OUTPUT
echo "whl_name=$whl_name" >> $GITHUB_OUTPUT
- name: Upload wheel artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.get_filename.outputs.whl_file }}
path: ${{ steps.get_filename.outputs.whl_file }}
if-no-files-found: error