-
Notifications
You must be signed in to change notification settings - Fork 30
104 lines (87 loc) · 2.73 KB
/
build.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
name: build
on: [push]
jobs:
build_wheels:
name: Build ${{ matrix.archs }} ${{ matrix.build }} wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
archs: ["x86_64, i686", "aarch64", "ppc64le", "s390x"]
build: ["manylinux", "musllinux"]
include:
- os: windows-2019
archs: "AMD64"
- os: windows-2019
archs: "x86"
- os: windows-2019
archs: "ARM64"
- os: macos-11
archs: "x86_64, arm64"
steps:
- name: Disable git autocrlf
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
if: runner.os == 'Linux'
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS: "${{ matrix.archs }}"
CIBW_BUILD: "${{ matrix.build && '*-' || ''}}${{ matrix.build }}*"
CIBW_PRERELEASE_PYTHONS: "${{ !startsWith(github.ref, 'refs/tags/v') }}"
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
build_sdist:
name: Build sdist
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ['3.10']
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: python -m pip install -U pip 'setuptools>=45' 'setuptools-scm>=6.2'
- name: Build sdist
run: python setup.py build sdist
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
upload_pypi:
name: Upload to (Test) PyPI
needs: [build_wheels, build_sdist]
runs-on: ubuntu-20.04
if: github.event_name == 'push' && github.repository == 'ifduyue/python-xxhash'
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- name: Upload to Test PyPI
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_TEST_TOKEN }}
skip_existing: true
repository_url: https://test.pypi.org/legacy/
- name: Upload to PyPI
if: startsWith(github.ref, 'refs/tags/v')
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
skip_existing: true