-
Notifications
You must be signed in to change notification settings - Fork 16
168 lines (164 loc) · 6.11 KB
/
release.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
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
163
164
165
166
167
168
name: Release
# This should almost always run, but upload binaries only on tag.
on:
pull_request:
branches: [ master ]
workflow_dispatch:
push:
branches: [ master ]
tags:
- '*.*.*'
# Cancel previous runs on the same PR.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
release_manylinux:
name: Release manylinux
runs-on: ubuntu-latest
strategy:
matrix:
python-path: ['cp38-cp38', 'cp39-cp39', 'cp310-cp310', 'cp311-cp311', 'cp312-cp312']
container: quay.io/pypa/manylinux2014_x86_64:latest
env:
TWINE_PASSWORD: ${{secrets.TWINE_PASSWORD}}
TWINE_USERNAME: ${{secrets.TWINE_USERNAME}}
CC: "gcc"
CFLAGS: "-O2 -fno-plt"
LDFLAGS: "-O2 -flto -Wl,--as-needed"
CARGO_UNSTABLE_SPARSE_REGISTRY: "true"
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rust-src
- run: yum install -y libffi libffi-devel openssl openssl-devel
- run: /opt/python/${{ matrix.python-path }}/bin/python -m venv .venv
- run: .venv/bin/pip install -U pip wheel
- run: .venv/bin/pip install -U twine maturin
- run: .venv/bin/pip install -r requirements.txt
- run: .venv/bin/maturin build --features=unstable-simd --release --strip --manylinux 2014 -i /opt/python/${{ matrix.python-path }}/bin/python --target x86_64-unknown-linux-gnu
- run: .venv/bin/pip install ormsgpack --no-index -f target/wheels
- run: .venv/bin/pytest
- if: startsWith(github.ref, 'refs/tags')
run: .venv/bin/twine upload --non-interactive --skip-existing target/wheels/*
release_windows:
name: Release windows
runs-on: windows-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
env:
TWINE_PASSWORD: ${{secrets.TWINE_PASSWORD}}
TWINE_USERNAME: ${{secrets.TWINE_USERNAME}}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rust-src
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- run: python -m pip install --user -U pip wheel twine maturin
- run: pip install -r requirements.txt
- run: maturin build --release --strip -i $pythonLocation"python.exe"
- run: pip install ormsgpack --no-index -f target/wheels
- run: pytest
- if: startsWith(github.ref, 'refs/tags')
run: twine upload --non-interactive --skip-existing target\wheels\*
release_macos_x64:
name: Release macOS (x86_64)
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
runs-on: macos-latest
env:
TWINE_PASSWORD: ${{secrets.TWINE_PASSWORD}}
TWINE_USERNAME: ${{secrets.TWINE_USERNAME}}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rust-src
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- run: python -m pip install -U pip wheel twine maturin
- run: pip install -r requirements.txt
- env:
CC: "clang"
CFLAGS: "-O2 -fno-plt -flto=thin"
LDFLAGS: "-O2 -flto=thin -fuse-ld=lld -Wl,--as-needed"
RUSTFLAGS: "-C linker=clang -C target-feature=+sse4.2"
CARGO_UNSTABLE_SPARSE_REGISTRY: "true"
run: maturin build --release --strip --manylinux off -i $pythonLocation/python --features=unstable-simd -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort --target x86_64-apple-darwin
- run: pip install ormsgpack --no-index -f target/wheels
- run: pytest
- if: startsWith(github.ref, 'refs/tags')
run: twine upload --non-interactive --skip-existing target/wheels/*
release_macos_universal:
name: Release macOS (universal)
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
runs-on: macos-latest
env:
TWINE_PASSWORD: ${{secrets.TWINE_PASSWORD}}
TWINE_USERNAME: ${{secrets.TWINE_USERNAME}}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
target: aarch64-apple-darwin
components: rust-src
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- run: python -m pip install -U pip wheel twine maturin
- env:
CC: "clang"
CFLAGS: "-O2 -fno-plt -flto=thin"
LDFLAGS: "-O2 -flto=thin -fuse-ld=lld -Wl,--as-needed"
RUSTFLAGS: "-C linker=clang"
CARGO_UNSTABLE_SPARSE_REGISTRY: "true"
run: PATH=$HOME/.cargo/bin:$PATH PYO3_CROSS_LIB_DIR=$(python -c "import sysconfig;print(sysconfig.get_config_var('LIBDIR'))") maturin build --release --strip --features=unstable-simd --target universal2-apple-darwin
- if: startsWith(github.ref, 'refs/tags')
run: twine upload --non-interactive --skip-existing target/wheels/*
release_sdist:
name: Release sdist
runs-on: ubuntu-latest
env:
TWINE_PASSWORD: ${{secrets.TWINE_PASSWORD}}
TWINE_USERNAME: ${{secrets.TWINE_USERNAME}}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rust-src
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- run: python -m pip install -U pip wheel twine maturin
- run: pip install -r requirements.txt
- run: maturin sdist
- if: startsWith(github.ref, 'refs/tags')
run: twine upload --non-interactive --skip-existing target/wheels/*