-
Notifications
You must be signed in to change notification settings - Fork 94
156 lines (144 loc) · 4.76 KB
/
deploy.yaml
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
name: Build sdist and wheels
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency
# https://docs.github.com/en/developers/webhooks-and-events/events/github-event-types#pullrequestevent
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.event.ref }}-${{ github.event.type }}
cancel-in-progress: true
on:
push:
pull_request:
release:
types:
- published
jobs:
build_sdist:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Create sdist
shell: bash -l {0}
# For non-tags/releases this won't produce a valid version number in the package
# We'd have to download the entire git history which is wasteful in CI
run: |
python -m pip install -q build
python -m build -s
- name: Upload sdist to build artifacts
uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
build_wheels:
name: "Build wheels on ${{ matrix.os }} ${{ matrix.cibw_archs }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-2019
cibw_archs: "AMD64 ARM64"
artifact_name: "win"
- os: macos-12
cibw_archs: "x86_64 arm64"
artifact_name: "mac"
- os: "ubuntu-20.04"
cibw_archs: "aarch64"
artifact_name: "ubuntu-aarch"
- os: "ubuntu-20.04"
cibw_archs: "x86_64"
artifact_name: "ubuntu-x86_64"
steps:
- uses: actions/checkout@v4
- run: |
git fetch --prune --unshallow
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_SKIP: "cp36-* cp37-* cp38-* cp313-* pp* *i686 *-musllinux*"
CIBW_ARCHS: "${{ matrix.cibw_archs }}"
CIBW_TEST_COMMAND: "python -c \"import pyresample; assert 'unknown' not in pyresample.__version__, 'incorrect version found'\""
CIBW_TEST_SKIP: "*_arm64 *_universal2:arm64"
- name: Upload wheel(s) as build artifacts
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.artifact_name }}
path: ./wheelhouse/*.whl
upload_test_pypi:
needs: [build_sdist, build_wheels]
runs-on: ubuntu-latest
# upload to PyPI on every tag starting with 'v'
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
steps:
- name: Download sdist artifact
uses: actions/download-artifact@v4
with:
name: sdist
path: dist
- name: Download wheels artifact - win
uses: actions/download-artifact@v4
with:
name: wheels-win
path: dist
- name: Download wheels artifact - mac
uses: actions/download-artifact@v4
with:
name: wheels-mac
path: dist
- name: Download wheels artifact - ubuntu aarch
uses: actions/download-artifact@v4
with:
name: wheels-ubuntu-aarch
path: dist
- name: Download wheels artifact - ubuntu x86_64
uses: actions/download-artifact@v4
with:
name: wheels-ubuntu-x86_64
path: dist
- name: Publish package to PyPI
if: github.event.action != 'published'
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.test_pypi_password }}
repository_url: https://test.pypi.org/legacy/
upload_pypi:
needs: [build_sdist, build_wheels]
runs-on: ubuntu-latest
steps:
- name: Download sdist artifact
uses: actions/download-artifact@v4
with:
name: sdist
path: dist
- name: Download wheels artifact - win
uses: actions/download-artifact@v4
with:
name: wheels-win
path: dist
- name: Download wheels artifact - mac
uses: actions/download-artifact@v4
with:
name: wheels-mac
path: dist
- name: Download wheels artifact - ubuntu aarch
uses: actions/download-artifact@v4
with:
name: wheels-ubuntu-aarch
path: dist
- name: Download wheels artifact - ubuntu x86_64
uses: actions/download-artifact@v4
with:
name: wheels-ubuntu-x86_64
path: dist
- name: Publish package to PyPI
if: github.event.action == 'published'
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.pypi_password }}
skip_existing: true