Build and Publish Wheel to GitHub Pages #4
This file contains hidden or 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 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 |