Skip to content

Standalone build workflow to be used by publish workflow and on new PRs & linter fixes #1

Standalone build workflow to be used by publish workflow and on new PRs & linter fixes

Standalone build workflow to be used by publish workflow and on new PRs & linter fixes #1

Workflow file for this run

name: Build distribution 📦
on:
workflow_call:
workflow_dispatch:
pull_request:
jobs:
build-package:
runs-on: ubuntu-latest
steps:
- id: check_ref
run: echo "::set-output name=match::$(echo '${{ github.ref }}' | grep -Pq '^refs/tags/v\d+\.\d+\.\d+$' && echo true || echo false)"
shell: bash
- name: Check if tag is valid
if: steps.check_ref.outputs.match != 'true'
run: exit 1
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install hatch
run: |
pip install hatch --user
- name: Run tests
run: |
python3 -m hatch run test
- name: Run linting
run: |
python3 -m hatch run lint:all
- name: Build a wheel and a source tarball
run: |
python3 -m hatch build