-
Notifications
You must be signed in to change notification settings - Fork 55
143 lines (124 loc) · 4.19 KB
/
pip-install.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
name: pip-install
on:
release:
types: [published]
jobs:
build_wheels:
name: Building wheel for ${{ matrix.os }}:Python-${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-12, macos-13, macos-14]
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
exclude:
- os: ubuntu-22.04
python-version: '3.6'
- os: macos-14
python-version: '3.6'
- os: macos-14
python-version: '3.7'
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Set up Python
id: setup_python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install packages
run: |
python -m pip install -U pip
python -m pip install setuptools
python -m pip install cibuildwheel
- name: Build wheel on Linux
if: runner.os == 'Linux'
run: |
python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: 'cp3?-*'
CIBW_SKIP: '*-manylinux_i686'
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
- name: Build wheel on macOS
if: runner.os == 'macOS'
run: |
python -m cibuildwheel --output-dir wheelhouse
- name: Upload wheel artifact
uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.os }}-${{ matrix.python-version }}
path: ./wheelhouse/*.whl
build_sdist:
name: Building source for ${{ matrix.os }}:Python-${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-12, macos-13, macos-14]
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
exclude:
- os: ubuntu-22.04
python-version: '3.6'
- os: macos-14
python-version: '3.6'
- os: macos-14
python-version: '3.7'
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: ${{ matrix.python-version }}
- name: Install packages
run: |
python -m pip install -U pip
python -m pip install setuptools
- name: Build sdist
run: python setup.py sdist
- name: Upload sdist artifact
uses: actions/upload-artifact@v4
with:
name: sdist-${{ matrix.os }}-${{ matrix.python-version }}
path: dist/*.tar.gz
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-22.04
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-12, macos-13, macos-14]
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
exclude:
- os: ubuntu-22.04
python-version: '3.6'
- os: macos-14
python-version: '3.6'
- os: macos-14
python-version: '3.7'
fail-fast: false
steps:
- uses: actions/download-artifact@v4
with:
name: wheel-${{ matrix.os }}-${{ matrix.python-version }}
path: wheelhouse
- uses: actions/download-artifact@v4
with:
name: sdist-${{ matrix.os }}-${{ matrix.python-version }}
path: dist
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install twine
- name: Upload to PyPI
if: github.repository == 'VirtualPlanetaryLaboratory/vplanet'
run: python -m twine upload dist/* wheelhouse/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.pypi_password }}
# Only push to PyPI if we're on the public repo!
# - uses: pypa/gh-action-pypi-publish@release/v1
# if: (!github.event.release.prerelease) && github.event_name == 'release' && github.event.action == 'published' && github.repository == 'VirtualPlanetaryLaboratory/vplanet'
# with:
# user: __token__
# password: ${{ secrets.pypi_password }}