132 lines (117 loc) · 3.8 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
name: Deploy sdist and wheels
on:
push:
tags:
- v*
release:
types:
- published
jobs:
build_sdist:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Create sdist
shell: bash -l {0}
run: |
pip install -q build
python -m build -s
- name: Upload sdist to build artifacts
uses: actions/upload-artifact@v2
with:
name: sdist
path: dist/*.tar.gz
build_wheels:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest]
python-version: ["3.7", "3.8", "3.9", "3.10"]
include:
# Using pythons inside a docker image to provide all the Linux
# python-versions permutations.
- name: manylinux 64-bit
os: ubuntu-latest
python-version: 3.8
docker-image: manylinux2014_x86_64
steps:
- uses: actions/checkout@v2
- run: |
git fetch --prune --unshallow
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: "${{ matrix.python-version }}"
- name: Install dependencies
run: |
python -m pip install -U -q pip Cython wheel setuptools twine numpy build
- name: Build and install macOS/Windows wheel
if: matrix.os != 'ubuntu-latest'
# see https://setuptools.readthedocs.io/en/latest/build_meta.html
run: |
python -m build
pip install --find-links=./dist/ python-geotiepoints
- name: Build Linux wheels inside docker
if: matrix.os == 'ubuntu-latest'
run: |
docker run \
-e PLAT=${{ matrix.docker-image }} \
-e USE_OMP=1 \
-v `pwd`:/io \
quay.io/pypa/${{ matrix.docker-image }} \
/io/continuous_integration/build-manylinux-wheels.sh
- name: Check version number from inside wheel
if: matrix.docker-image != 'manylinux2014_i686'
run: |
mv geotiepoints unused_src_to_prevent_local_import
python -m pip install --find-links=./dist/ python-geotiepoints
python -c "import geotiepoints; print(geotiepoints.__file__, geotiepoints.__version__)"
python -c "import geotiepoints; assert 'unknown' not in geotiepoints.__version__, 'incorrect version found'"
- name: Upload wheel(s) as build artifacts
uses: actions/upload-artifact@v2
with:
name: wheels
path: dist/*.whl
upload_test_pypi:
needs: [build_sdist, build_wheels]
runs-on: ubuntu-latest
steps:
- name: Download sdist artifact
uses: actions/download-artifact@v2
with:
name: sdist
path: dist
- name: Download wheels artifact
uses: actions/download-artifact@v2
with:
name: wheels
path: dist
- name: Publish package to PyPI
if: github.event.action != 'published'
uses: pypa/gh-action-pypi-publish@v1.4.1
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@v2
with:
name: sdist
path: dist
- name: Download wheels artifact
uses: actions/download-artifact@v2
with:
name: wheels
path: dist
- name: Publish package to PyPI
if: github.event.action == 'published'
uses: pypa/gh-action-pypi-publish@v1.4.1
with:
user: __token__
password: ${{ secrets.pypi_password }}