-
Notifications
You must be signed in to change notification settings - Fork 32
87 lines (75 loc) · 2.18 KB
/
cibuildwheel.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
name: Wheels
on:
pull_request:
push:
tags:
- "v*"
jobs:
build_bdist:
name: "Build ${{ matrix.os }} (${{ matrix.arch }}) wheels"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
arch: ["x86_64", "arm64", "AMD64"]
exclude:
- os: ubuntu-latest
arch: arm64
- os: ubuntu-latest
arch: AMD64
- os: windows-latest
arch: arm64
- os: windows-latest
arch: x86_64
- os: macos-latest
arch: AMD64
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "Building ${{ matrix.os }} (${{ matrix.arch }}) wheels"
uses: pypa/[email protected]
env:
# Skips pypy and musllinux for now.
CIBW_SKIP: "pp* cp36-* cp37-* *-musllinux*"
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_BUILD_FRONTEND: build
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_TEST_SKIP: "*_arm64"
CIBW_TEST_REQUIRES: pytest pandas>=2
CIBW_TEST_COMMAND: >
python -c "import gsw; print(f'gsw v{gsw.__version__}')" &&
python -m pytest --pyargs gsw
- uses: actions/upload-artifact@v4
with:
name: pypi-artifacts
path: ${{ github.workspace }}/wheelhouse/*.whl
show-artifacts:
needs: [build_bdist]
name: "Show artifacts"
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: pypi-artifacts
path: ${{ github.workspace }}/dist
- shell: bash
run: |
ls -l ${{ github.workspace }}/dist
publish-artifacts-pypi:
needs: [build_bdist]
name: "Publish to PyPI"
runs-on: ubuntu-latest
# upload to PyPI for every tag starting with 'v'
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v3
with:
name: pypi-artifacts
path: ${{ github.workspace }}/dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
print_hash: true