-
Notifications
You must be signed in to change notification settings - Fork 35
118 lines (111 loc) · 3.71 KB
/
Copy pathwheels.yml
File metadata and controls
118 lines (111 loc) · 3.71 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
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: Python Wheels
on:
workflow_dispatch:
push:
branches:
- main
tags:
- "v*"
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
env:
IROH_FORCE_STAGING_RELAYS: "1"
jobs:
manylinux:
runs-on: ${{ matrix.runner }}
container: ${{ matrix.container }}
strategy:
matrix:
name: [ubuntu-latest, ubuntu-arm-latest]
include:
- name: ubuntu-latest
release-os: manylinux_2_28
release-arch: x86_64
container: quay.io/pypa/manylinux_2_28_x86_64
runner: [self-hosted, linux, X64]
- name: ubuntu-arm-latest
release-os: manylinux_2_28
release-arch: aarch64
container: quay.io/pypa/manylinux_2_28_aarch64
runner: [self-hosted, linux, ARM64]
steps:
- uses: actions/checkout@v4
- name: Install rust + cargo-make
run: |
curl --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
source $HOME/.cargo/env
cargo install cargo-make
- name: Install maturin & uniffi-bindgen
run: /opt/python/cp311-cp311/bin/pip install -U maturin uniffi-bindgen
- name: cargo make python-wheel-manylinux
run: |
source $HOME/.cargo/env
export PATH=/opt/python/cp311-cp311/bin:$PATH
cargo make python-wheel-manylinux
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.release-os }}-${{ matrix.release-arch }}
path: target/wheels/*.whl
# Consumed by the `publish` job in the same run. 3 days leaves margin
# to re-run a failed publish without holding ~3GB for 90 days.
retention-days: 3
osx:
# arm64-only: the org has no GitHub-hosted macOS and x86_64 mac wheels
# were dropped.
runs-on: [self-hosted, macOS, ARM64]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: pip install -U maturin uniffi-bindgen
- name: maturin build
run: maturin build --release --target aarch64-apple-darwin
- uses: actions/upload-artifact@v4
with:
name: wheels-darwin-aarch64
path: target/wheels/*.whl
retention-days: 3
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: davidB/rust-cargo-make@v1
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: pip install -U maturin uniffi-bindgen
- name: cargo make python-wheel
run: cargo make python-wheel
- uses: actions/upload-artifact@v4
with:
name: wheels-windows-x86_64
path: target/wheels/*.whl
retention-days: 3
publish:
name: Publish wheels to PyPI
needs: [manylinux, osx, windows]
if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/v')
runs-on: [self-hosted, linux, X64]
# Trusted Publishing (OIDC) — no long-lived PyPI token needed. Requires
# the publisher to be registered once at
# https://pypi.org/manage/account/publishing/ (project: iroh,
# owner: n0-computer, repo: iroh-ffi, workflow: wheels.yml).
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
path: dist/
merge-multiple: true
- run: ls -la dist/
- uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true