-
Notifications
You must be signed in to change notification settings - Fork 10
95 lines (81 loc) · 2.35 KB
/
build-wheels.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Build Wheels
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
permissions:
contents: write
strategy:
matrix:
include:
# Linux builds
- os: ubuntu-latest
python-version: '3.10'
- os: ubuntu-latest
python-version: '3.11'
- os: ubuntu-latest
python-version: '3.12'
# Windows builds
- os: windows-latest
python-version: '3.10'
- os: windows-latest
python-version: '3.11'
- os: windows-latest
python-version: '3.12'
# macOS builds
- os: macos-latest
python-version: '3.10'
- os: macos-latest
python-version: '3.11'
- os: macos-latest
python-version: '3.12'
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install build dependencies
run: |
python -m pip install build pip wheel
shell: bash
- name: Build wheels
run: |
# Create dist directory
mkdir -p dist
# First build our package wheel without dependencies
pip wheel --no-deps -w dist/ .
# Then build all dependencies
pip wheel -r requirements.txt --wheel-dir dist/
shell: bash
- name: Build source distribution
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
run: python -m build --sdist
shell: bash
- name: Upload to GitHub Actions
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.os }}-py${{ matrix.python-version }}
path: dist/*
release:
needs: build_wheels
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
pattern: dist-*
path: dist
merge-multiple: true
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: dist/*