-
Notifications
You must be signed in to change notification settings - Fork 0
201 lines (177 loc) · 5.58 KB
/
publish.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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
name: Upload PyPI Release
on:
release:
types:
- published
# pull_request:
# push:
jobs:
build_wheel_on_linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@master
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine cython auditwheel patchelf>=0.14
# sudo apt-get install patchelf
- name: Build # and publish
# env:
# TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
# TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
# build manylinux wheel
auditwheel repair dist/*-linux_x86_64.whl -w dist/ --plat manylinux_2_24_x86_64
# auditwheel repair dist/*.whl
# remove original whl files
rm -r -f dist/*-linux_x86_64.whl
# # twine upload [[lib]]-manylinux_2_24_x86_64.whl
# twine upload dist/*
- name: Upload to artifacts
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/*
build_wheel_on_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@master
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine cython
- name: Build # and publish
# env:
# TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
# TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
# remove source files
del dist\*.tar.gz
- name: Upload to artifacts
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/*
publish_to_pypi:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: [build_wheel_on_linux, build_wheel_on_windows]
steps:
- name: Checkout scikit-learn
uses: actions/checkout@v3
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: dist
path: dist
- name: Set up Python
uses: actions/setup-python@master
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install twine
# # unzip artifact
# mkdir dist
# sudo apt-get install zip unzip
# unzip artifact.zip -d dist/
- name: Publish to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: twine upload dist/*
# name: Upload PyPI Releaseld
# on:
# release:
# types:
# - published
# pull_request:
# # push:
# jobs:
# # build_sdist :
# # name : Build distribution on Linux
# # runs-on: ubuntu-latest
# # steps:
# # - uses: actions/checkout@master
# # - name: Set up Python
# # uses: actions/setup-python@master
# # with:
# # python-version: 3.9
# # - name: Install dependencies
# # run: |
# # python -m pip install --upgrade pip
# # pip install setuptools wheel twine cython auditwheel patchelf>=0.14
# # # sudo apt-get install patchelf
# # - name: Build and publish
# # env:
# # TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
# # TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
# # run: |
# # python setup.py sdist bdist_wheel
# build_wheels:
# name: Build wheels on ${{ matrix.os }}
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# os: [ubuntu-latest, windows-latest]
# python_version:
# - 3.8
# - 3.9
# steps:
# - uses: actions/checkout@master
# # - name: Set up Python
# # uses: actions/setup-python@master
# # with:
# # python-version: 3.9
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install setuptools wheel twine cython cibuildwheel
# # pip install auditwheel patchelf>=0.14
# # sudo apt-get install patchelf
# - name: Build wheels
# run: python -m cibuildwheel --output-dir dist
# # to supply options, put them in 'env', like:
# # env:
# # CIBW_SOME_OPTION: value
# - uses: actions/upload-artifact@v3
# with:
# path: ./dist/*
# # - name: Publish to PyPI
# # env:
# # TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
# # TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
# # run: |
# # twine upload dist/*
# publish:
# name: Publish to PyPI
# runs-on: ubuntu-latest
# steps:
# - uses: actions/upload-artifact@v3
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install setuptools wheel twine cython cibuildwheel
# - name: publish
# env:
# TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
# TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
# run: |
# twine upload dist/*