-
Notifications
You must be signed in to change notification settings - Fork 410
72 lines (62 loc) · 1.99 KB
/
python-build-and-upload-packages.yml
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Python - build and upload packages
on:
push:
branches:
- 'main'
tags:
- 'python-v*'
# We don't nned to create artifacts for each PR, but this makes it much
# easier to test this workflow. Remove comments when needed.
# pull_request:
# paths:
# - 'python/**'
# - 'rust/**'
# - 'tests_data/**'
# - '.github/workflows/**'
workflow_dispatch:
permissions:
contents: read
jobs:
build:
name: ${{ matrix.conf.name }}
runs-on: ${{ matrix.conf.runner }}
strategy:
matrix:
conf:
- name: linux
runner: ubuntu-latest
- name: windows
runner: windows-latest
- name: macos
runner: macos-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # pin@v4
- name: Setup Python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # pin@v5
with:
python-version-file: 'python/.python-version'
- name: Install uv
run: curl -LsSf https://astral.sh/uv/0.4.7/install.sh | sh
# It's OK to use the default python version and not the specified one
- name: Install all projects dependencies
working-directory: python
run: uv sync --all-extras --dev
- name: Build the python package
working-directory: python
run: uv run ./scripts/build_python_package.py
- name: List wheels
working-directory: python
run: python -c "import os; print('\n'.join(os.listdir('dist')))"
- name: Upload wheel
uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.conf.name }}
path: python/dist/*.whl
# We upload the source tarball only for linux as it's the same for the
# other platforms.
- name: Upload source tarball
if: ${{ matrix.conf.name == 'linux' }}
uses: actions/upload-artifact@v4
with:
name: source-tarball
path: python/dist/*.tar.gz