-
Notifications
You must be signed in to change notification settings - Fork 121
159 lines (138 loc) · 4.22 KB
/
github-deploy.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
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
157
158
159
name: Build and upload to PyPI
on:
push:
branches:
- release
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }} for ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
arch: x86_64
build: "*-manylinux_*"
- os: ubuntu-latest
arch: x86_64
build: "*-musllinux_*"
- os: ubuntu-latest
arch: i686
build: "*-manylinux_*"
- os: ubuntu-latest
arch: i686
build: "*-musllinux_*"
- os: ubuntu-latest
arch: aarch64
build: "*-manylinux_*"
- os: ubuntu-latest
arch: aarch64
build: "*-musllinux_*"
- os: ubuntu-latest
arch: s390x
build: "*-manylinux_*"
- os: ubuntu-latest
arch: s390x
build: "*-musllinux_*"
- os: windows-latest
arch: AMD64
- os: windows-latest
arch: x86
- os: macos-latest
arch: x86_64
- os: macos-latest
arch: arm64
steps:
- uses: actions/checkout@v4
- name: Generate build name for artifact upload
id: build-name
if: runner.os == 'Linux'
run: |
name=""
if [[ -n "${{ matrix.build }}" ]]; then
name="-$(echo ${{ matrix.build }} | tr -d *-_)"
fi
echo "name: ${name}"
echo "name=${name}" >> $GITHUB_OUTPUT
# https://cibuildwheel.readthedocs.io/en/stable/faq/#emulation
# offers this stanza plus “CIBW_ARCHS_LINUX” below:
- 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_ARCHS: ${{ matrix.arch }}
CIBW_BUILD: ${{ matrix.build }}
CIBW_SKIP: pp*
CIBW_TEST_COMMAND: python -m unittest discover ephem
CIBW_TEST_REQUIRES: tzdata
CIBW_TEST_SKIP: "*-macosx_arm64 *-macosx_universal2:arm64"
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-${{ matrix.arch }}${{ steps.build-name.outputs.name }}
path: ./wheelhouse/*.whl
overwrite: true
build_wheels_python2:
name: Build wheels on ${{ matrix.os }} (Python 2.7)
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-13]
steps:
- uses: actions/checkout@v4
# https://cibuildwheel.readthedocs.io/en/stable/faq/#emulation
# offers this stanza plus “CIBW_ARCHS_LINUX” below:
- 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_ARCHS_LINUX: auto aarch64 s390x
CIBW_BUILD: cp27-*
CIBW_SKIP: pp*
CIBW_TEST_COMMAND: python -m unittest discover ephem
CIBW_TEST_REQUIRES: tzdata
- uses: actions/upload-artifact@v4
with:
name: wheels-2.7-${{ matrix.os }}
path: ./wheelhouse/*.whl
overwrite: true
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.8'
- name: Build sdist
run: python setup.py sdist
- uses: actions/upload-artifact@v4
with:
name: wheels-sdist
path: dist/*.tar.gz
overwrite: true
upload_pypi:
needs: [build_wheels, build_wheels_python2, build_sdist]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
user: __token__
password: ${{ secrets.pypi_password }}
# To test: repository_url: https://test.pypi.org/legacy/