forked from ijl/orjson
-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (83 loc) · 2.66 KB
/
Copy pathmusllinux.yaml
File metadata and controls
86 lines (83 loc) · 2.66 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
name: musllinux
on:
push:
branches:
- '*'
tags:
- '*'
jobs:
musllinux:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
python: [
{ version: '3.7' },
{ version: '3.8' },
{ version: '3.9' },
{ version: '3.10' },
]
platform:
- target: aarch64-unknown-linux-musl
arch: aarch64
- target: x86_64-unknown-linux-musl
arch: x86_64
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python.version }}
- name: Build wheels
uses: messense/maturin-action@v1
with:
maturin-version: v0.12.19
rust-toolchain: nightly-2022-06-22
target: ${{ matrix.platform.target }}
manylinux: musllinux_1_1
args: --release --strip --out dist --no-sdist --cargo-extra-args="--features=unstable-simd,yyjson" -i python${{ matrix.python.version }}
- name: Set up QEMU
if: matrix.platform.arch != 'x86_64'
uses: docker/setup-qemu-action@v2
with:
image: tonistiigi/binfmt:qemu-v6.2.0
platforms: all
- name: Install built wheel
uses: addnab/docker-run-action@v3
with:
image: quay.io/pypa/musllinux_1_1_${{ matrix.platform.arch }}:latest
options: -v ${{ github.workspace }}:/io -w /io
run: |
# workaround zoneinfo._common.ZoneInfoNotFoundError: 'No time zone found with key UTC'
# exception when running tests
apk add tzdata
# Don't install numpy since there are no musllinux wheels
sed -i '/^numpy/d' test/requirements.txt
PYTHON=python${{ matrix.python.version }}
$PYTHON -m venv venv
venv/bin/pip install -U pip
venv/bin/pip install -r test/requirements.txt
venv/bin/pip install orjson --no-index --find-links dist/ --force-reinstall
venv/bin/python -m pytest -s -rxX -v test
- name: Upload wheels
uses: actions/upload-artifact@v2
with:
name: wheels
path: dist
release:
name: Release
runs-on: ubuntu-22.04
if: "startsWith(github.ref, 'refs/tags/')"
needs: [ musllinux ]
steps:
- uses: actions/download-artifact@v2
with:
name: wheels
- uses: actions/setup-python@v2
with:
python-version: "3.10"
- run: pip install "maturin>=0.12.19,<0.13"
- name: deploy
run: maturin upload --skip-existing --username "$MATURIN_USERNAME" *.whl
env:
MATURIN_USERNAME: ${{ secrets.TWINE_USERNAME }}
MATURIN_PASSWORD: ${{ secrets.TWINE_PASSWORD }}