-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (86 loc) · 3.18 KB
/
python-net-release.yml
File metadata and controls
101 lines (86 loc) · 3.18 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
name: Build Python WebSocket Wheels
on:
push:
tags:
- "python-v*"
paths:
- "experiments/bindings/python-ws-client/**"
- ".github/workflows/*.yml"
pull_request:
paths:
- "experiments/bindings/python-ws-client/**"
- ".github/workflows/*.yml"
jobs:
build:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
# This was opted for instead of using `working-directory`, which breaks
# tools like `maturin` and `cibuildwheel` that expect the workspace root.
PYTHON_BINDING_DIR: experiments/bindings/python-ws-client
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
shell: bash
- name: Run integration and unit tests
run: |
chmod +x experiments/bindings/python-ws-client/integration_test.sh
./experiments/bindings/python-ws-client/integration_test.sh
shell: bash
- name: Install cibuildwheel
run: uv pip install --system cibuildwheel==2.23.3
shell: bash
# Note: Using `working-directory` here is problematic due to relative path linking
- name: Build wheels
env:
CIBW_SKIP: "cp36-* cp37-* cp38-* cp39-* pp* *-manylinux_i686 *-musllinux_*"
run: cibuildwheel "${{ env.PYTHON_BINDING_DIR }}" --output-dir "${{ env.PYTHON_BINDING_DIR }}/dist"
shell: bash
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: simd-r-drive-ws-client-wheels-${{ matrix.os }}
path: ${{ env.PYTHON_BINDING_DIR }}/dist/*.whl
publish:
name: Upload wheels to PyPI
needs: build
runs-on: ubuntu-latest
# Accept tags like: python-v0.3.0-test or python-v0.3.0
# Example test tagging:
# git tag python-v0.3.0-test (or `*-test2`, etc)
# git push origin python-v0.3.0-test (or `*-test2`, etc)
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/python-v')
steps:
- uses: actions/checkout@v4
- name: Download built wheels from all platforms
uses: actions/download-artifact@v4
with:
pattern: simd-r-drive-ws-client-wheels-*
merge-multiple: true
path: dist
- name: Determine PyPI repository and token
id: pypi
run: |
if [[ "${GITHUB_REF}" == *-test* ]]; then
echo "url=https://test.pypi.org/legacy/" >> $GITHUB_OUTPUT
echo "token=${{ secrets.PYPI_TEST_API_TOKEN }}" >> $GITHUB_OUTPUT
else
echo "url=https://upload.pypi.org/legacy/" >> $GITHUB_OUTPUT
echo "token=${{ secrets.PYPI_API_TOKEN }}" >> $GITHUB_OUTPUT
fi
- name: Upload to PyPI (or Test PyPI)
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: ${{ steps.pypi.outputs.url }}
user: __token__
password: ${{ steps.pypi.outputs.token }}