-
Notifications
You must be signed in to change notification settings - Fork 9
47 lines (40 loc) · 1.15 KB
/
_build-python-wheel-pure.yml
File metadata and controls
47 lines (40 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Build wheel and sdist for a pure Python package
on:
workflow_call:
inputs:
python_version:
description: 'Python version to use for building'
required: true
type: number
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout the code
- name: Check out the repository
uses: actions/checkout@v6
with:
ref: ${{ github.ref }}
# Set up Python
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python_version }}
# Install build tool
- name: Install build dependencies
run: python -m pip install --upgrade build
# Build the package (creates both .whl and .tar.gz in ./dist)
- name: Build wheel and sdist
run: python -m build
# Upload the wheel file
- name: Upload wheel artifact
uses: actions/upload-artifact@v4
with:
name: wheel
path: ./dist/*.whl
# Upload the sdist file
- name: Upload sdist artifact
uses: actions/upload-artifact@v4
with:
name: sdist
path: ./dist/*.tar.gz