-
Notifications
You must be signed in to change notification settings - Fork 6
60 lines (57 loc) · 1.8 KB
/
Copy pathwheels.yml
File metadata and controls
60 lines (57 loc) · 1.8 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
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Build and Publish Wheels (Multi Arch)
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
release:
types: [created] # This triggers the job when a new GitHub release is created.
jobs:
build:
name: Build Wheels (${{ matrix.os }} - ${{ matrix.arch }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, ubuntu-22.04, macos-15, windows-2025]
arch: [x86_64]
include:
- os: ubuntu-24.04-arm
arch: aarch64
- os: ubuntu-22.04-arm
arch: aarch64
- os: macos-15
arch: arm64
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.x
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install dependencies
run: pip install --upgrade pip setuptools wheel twine
- name: Build wheels
run: pip wheel . -w dist
- name: Upload wheels artifact
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-${{ matrix.arch }}
path: dist/*
publish:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: build # Ensure this job only runs if the build completes successfully.
if: github.event_name == 'release' # Only publish when a release is created.
steps:
- uses: actions/checkout@v4
- name: Download all built wheels
uses: actions/download-artifact@v4
with:
path: dist
- name: Publish package to PyPI
env:
PYPI_USERNAME: __token__
PYPI_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python -m pip install --upgrade twine
python -m twine upload dist/** --username "$PYPI_USERNAME" --password "$PYPI_PASSWORD"