-
Notifications
You must be signed in to change notification settings - Fork 1
93 lines (88 loc) · 3.01 KB
/
release-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
# This workflow will create wheels files for all major distros for several versions of python.
# This only triggers on release tags.
name: Release-Wheels
on:
release:
types:
- published
push:
tags: 'v[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build_wheels:
name: Build wheel for py${{ matrix.python }}-${{ matrix.platform_id }}
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
# Ensure that a wheel builder finishes even if another fails
fail-fast: false
matrix:
python: [39, 310, 311, 312, 313]
os: [windows-latest, ubuntu-latest, macos-latest]
include:
# Window 64 bit
- os: windows-latest
platform_id: win_amd64
# Linux 64 bit manylinux2014
- os: ubuntu-latest
platform_id: manylinux_x86_64
manylinux_image: manylinux2014
# MacOS - latest is now arm64, no longer x86_64
- os: macos-latest
platform_id: macosx_arm64
steps:
- uses: actions/checkout@v4
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
- run: cargo test --all-features
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip setuptools
python3 -m pip install cibuildwheel
- name: Build wheels
env:
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }}
CIBW_ARCHS: all
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }}
CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.manylinux_image }}
CIBW_TEST_SKIP: "*-macosx_arm64"
CIBW_ENVIRONMENT: 'PATH="$HOME/.cargo/bin:$PATH" CARGO_TERM_COLOR="always"'
CIBW_ENVIRONMENT_WINDOWS: 'PATH="$UserProfile\.cargo\bin;$PATH"'
CIBW_BEFORE_BUILD: rustup show
CIBW_BEFORE_BUILD_LINUX: >
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=stable --profile=minimal -y &&
rustup show
CIBW_TEST_REQUIRES: pytest
CIBW_BUILD_VERBOSITY: 1
CONDA_HOME: /usr/local/miniconda
run: python3 -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v4
with:
name: wheel-cp${{ matrix.python }}-${{ matrix.platform_id }}
path: ./wheelhouse/*.whl
publish-to-pypi:
name: Publish Kete to PyPI
needs:
- build_wheels
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/kete
permissions:
id-token: write
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
pattern: wheel-*
path: dist
merge-multiple: true
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1