forked from obspy/obspy
-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (105 loc) · 3.29 KB
/
build_wheels.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
name: wheels
on:
pull_request:
push:
branches:
- master
tags:
- '*'
release:
types: [published]
concurrency:
group: wheels-${{ github.event_name }}-${{ github.ref_name }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
build_wheels:
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'test_wheels')
name: build (${{ matrix.os }}, ${{ matrix.build }})
runs-on: ${{ matrix.os }}
env:
CIBW_BUILD: '${{ matrix.build }}-*'
CIBW_SKIP: '*i686 *win32 *s390x *ppc64le *musllinux*'
CIBW_ENVIRONMENT: OBSPY_NODE_NAME='wheel-builder'
CIBW_TEST_COMMAND: obspy-runtests --report
CIBW_TEST_EXTRAS: tests
strategy:
# for pushes to master, we only build a subset of wheels
# this does not apply to tags
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
build: [cp38, cp39, cp310, cp311, cp312]
exclude-flag:
- ${{ github.ref_name == 'master' && github.event_name == 'push' }}
exclude:
- build: cp38
exclude-flag: true
- build: cp39
exclude-flag: true
- build: cp310
exclude-flag: true
- build: cp311
exclude-flag: true
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Adapt environment variables to build only some wheels
if: ${{ github.ref_name == 'master' && github.event_name == 'push' }}
shell: bash -l {0}
run: |
echo "CIBW_SKIP=$CIBW_SKIP *aarch64" >> "$GITHUB_ENV"
- name: Print environment variables
shell: bash -l {0}
run: |
echo "CIBW_BUILD: $CIBW_BUILD"
echo "CIBW_SKIP: $CIBW_SKIP"
echo "CIBW_TEST_COMMAND: $CIBW_TEST_COMMAND"
- name: Build and test wheels
uses: pypa/[email protected]
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
build_sdist:
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'test_wheels')
name: build sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build sdist
shell: bash -l {0}
run: pipx run build --sdist
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
publish_test:
name: publish tag to testpypi
if: github.event_name == 'push' && github.ref_type == 'tag'
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.TESTPYPI }}
repository_url: https://test.pypi.org/legacy/
publish:
name: publish release
if: github.event_name == 'release'
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI }}