-
-
Notifications
You must be signed in to change notification settings - Fork 1
162 lines (153 loc) · 5.03 KB
/
release.yml
File metadata and controls
162 lines (153 loc) · 5.03 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: release
on:
push:
tags:
- v*.*.*
env:
PY_ALL: 3.13t 3.14t
jobs:
sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pyo3/maturin-action@v1
with:
rust-toolchain: stable
command: sdist
args: --out dist
- name: Upload sdist
uses: actions/upload-artifact@v7
with:
name: dist-sdist
path: dist
wheels:
name: wheel ${{ matrix.platform || matrix.os }}(${{ matrix.target }}) - ${{ matrix.manylinux || 'auto' }}
strategy:
fail-fast: false
matrix:
os: [ubuntu, macos]
target: [x86_64, aarch64]
manylinux: [auto]
include:
- os: ubuntu
platform: linux
target: i686
- os: ubuntu
platform: linux
target: armv7
- os: ubuntu
platform: linux
target: x86_64
manylinux: musllinux_1_1
- os: ubuntu
platform: linux
target: aarch64
manylinux: musllinux_1_1
- os: ubuntu
platform: linux
target: armv7
manylinux: musllinux_1_1
# PGO builds
# exclude:
# - os: ubuntu
# target: x86_64
# - os: macos
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v6
- uses: pyo3/maturin-action@v1
with:
rust-toolchain: stable
command: build
args: --release --out dist --interpreter ${{ matrix.interpreter || env.PY_ALL }}
target: ${{ matrix.target }}
manylinux: ${{ matrix.manylinux || 'auto' }}
container: ${{ matrix.container }}
docker-options: -e CI
- name: Upload wheels
uses: actions/upload-artifact@v7
with:
name: dist-${{ matrix.platform || matrix.os }}-${{ matrix.target }}-${{ matrix.manylinux || 'auto' }}
path: dist
# wheels-pgo:
# name: pgo-wheel ${{ matrix.platform || matrix.os }} (${{ matrix.interpreter }})
# strategy:
# fail-fast: false
# matrix:
# os: [ubuntu-latest, macos-15-intel, macos-latest]
# manylinux: [auto]
# interpreter: ["3.14t"]
# include:
# - os: ubuntu-latest
# platform: linux
# runs-on: ${{ matrix.os }}
# env:
# UV_PYTHON: ${{ matrix.interpreter }}
# steps:
# - uses: actions/checkout@v6
# - uses: astral-sh/setup-uv@v7
# with:
# enable-cache: false
# - uses: dtolnay/rust-toolchain@stable
# with:
# components: llvm-tools
# - name: prepare profiling directory
# shell: bash
# run: mkdir -p ${{ github.workspace }}/profdata
# - name: Build initial wheel
# uses: PyO3/maturin-action@v1
# with:
# rust-toolchain: stable
# command: build
# args: --release --out pgo_wheel --interpreter ${{ matrix.interpreter }}
# manylinux: ${{ matrix.manylinux || 'auto' }}
# docker-options: -e CI
# env:
# RUSTFLAGS: "-Cprofile-generate=${{ github.workspace }}/profdata"
# - run: |
# RUST_HOST=$(rustc -Vv | grep host | cut -d ' ' -f 2) rustup run stable bash -c 'echo LLVM_PROFDATA=$RUSTUP_HOME/toolchains/$RUSTUP_TOOLCHAIN/lib/rustlib/$RUST_HOST/bin/llvm-profdata >> "$GITHUB_ENV"'
# shell: bash
# - name: Generate PGO data
# shell: bash
# run: |
# uv python install ${{ env.UV_PYTHON }}
# uv venv .venv
# uv sync --no-install-project --group test
# uv pip install tonio --no-index --no-deps --find-links pgo_wheel --force-reinstall
# LLVM_PROFILE_FILE=${{ github.workspace }}/profdata/ton_%m_%p.profraw uv run --no-sync pytest tests
# - name: merge PGO data
# run: ${{ env.LLVM_PROFDATA }} merge --failure-mode=all -o ${{ github.workspace }}/merged.profdata ${{ github.workspace }}/profdata
# - name: Build PGO wheel
# uses: PyO3/maturin-action@v1
# with:
# command: build
# args: --release --out dist --interpreter ${{ matrix.interpreter }}
# manylinux: ${{ matrix.manylinux || 'auto' }}
# rust-toolchain: stable
# docker-options: -e CI
# env:
# RUSTFLAGS: "-Cprofile-use=${{ github.workspace }}/merged.profdata"
# - name: Upload wheels
# uses: actions/upload-artifact@v7
# with:
# name: dist-pgo-${{ matrix.platform || matrix.os }}-${{ matrix.interpreter }}
# path: dist
release:
runs-on: ubuntu-latest
# needs: [ sdist, wheels, wheels-pgo ]
needs: [ sdist, wheels ]
environment:
name: pypi
url: https://pypi.org/p/tonio
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v8
with:
pattern: dist-*
merge-multiple: true
path: dist
- name: Publish package to pypi
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true