-
-
Notifications
You must be signed in to change notification settings - Fork 30
245 lines (228 loc) · 8.88 KB
/
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
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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
name: Publish new package
on:
push:
tags:
- 'v*.*.*'
- '!v*.*.*d'
workflow_dispatch:
jobs:
build_manylinux:
name: Build for manylinux2010
runs-on: ubuntu-latest
container:
image: docker://quay.io/pypa/manylinux2010_x86_64
steps:
- uses: actions/checkout@v1
with:
submodules: recursive
- name: Install Git LFS
run: |
mkdir gitlfs && pushd gitlfs
curl -L https://github.com/git-lfs/git-lfs/releases/download/v2.13.2/git-lfs-linux-amd64-v2.13.2.tar.gz | tar -zxv
./install.sh
popd
- name: Pull LFS files
run: cd Kiwi && git config --global --add safe.directory /__w/kiwipiepy/kiwipiepy/Kiwi && git lfs pull
- name: Deploy
continue-on-error: True
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
mv Kiwi/ModelGenerator/sj.* model/kiwipiepy_model/
mv Kiwi/ModelGenerator/extract.mdl model/kiwipiepy_model/
mv Kiwi/ModelGenerator/*.dict model/kiwipiepy_model/
mv Kiwi/ModelGenerator/combiningRule.txt model/kiwipiepy_model/
mv Kiwi/ModelGenerator/skipbigram.mdl model/kiwipiepy_model/
yum install libffi-devel -y
/opt/python/cp39-cp39/bin/python -m pip install --upgrade pip setuptools
/opt/python/cp39-cp39/bin/python -m pip install "readme-renderer==41.0" "cryptography<38" "twine<4" wheel numpy==`/opt/python/cp39-cp39/bin/python .github/workflows/numpy_version.py`
/opt/python/cp39-cp39/bin/python setup.py sdist
/opt/python/cp39-cp39/bin/python -m twine upload dist/*.tar.gz
for cp in cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39
do
/opt/python/${cp}/bin/python -m pip install wheel numpy==`/opt/python/${cp}/bin/python .github/workflows/numpy_version.py`
USE_MIMALLOC=1 /opt/python/${cp}/bin/python setup.py build bdist_wheel
auditwheel repair dist/*-${cp}-linux_x86_64.whl
done
/opt/python/cp39-cp39/bin/python -m twine upload wheelhouse/*.whl
cd model
/opt/python/cp39-cp39/bin/python setup.py sdist
/opt/python/cp39-cp39/bin/python -m twine upload dist/*.tar.gz
build_manylinux2014:
name: Build for manylinux2014
runs-on: ubuntu-latest
container:
image: docker://quay.io/pypa/manylinux2014_x86_64
steps:
- uses: actions/checkout@v1
with:
submodules: recursive
- name: Install Git LFS
run: |
mkdir gitlfs && pushd gitlfs
curl -L https://github.com/git-lfs/git-lfs/releases/download/v2.13.2/git-lfs-linux-amd64-v2.13.2.tar.gz | tar -zxv
./install.sh
popd
- name: Pull LFS files
run: cd Kiwi && git config --global --add safe.directory /__w/kiwipiepy/kiwipiepy/Kiwi && git lfs pull
- name: Deploy
continue-on-error: True
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
mv Kiwi/ModelGenerator/sj.* model/kiwipiepy_model/
mv Kiwi/ModelGenerator/extract.mdl model/kiwipiepy_model/
mv Kiwi/ModelGenerator/*.dict model/kiwipiepy_model/
mv Kiwi/ModelGenerator/combiningRule.txt model/kiwipiepy_model/
mv Kiwi/ModelGenerator/skipbigram.mdl model/kiwipiepy_model/
yum install libffi-devel -y
/opt/python/cp311-cp311/bin/python -m pip install --upgrade pip setuptools
/opt/python/cp311-cp311/bin/python -m pip install twine wheel numpy==`/opt/python/cp311-cp311/bin/python .github/workflows/numpy_version.py`
for cp in cp310-cp310 cp311-cp311 cp312-cp312
do
/opt/python/${cp}/bin/python -m pip install wheel numpy==`/opt/python/${cp}/bin/python .github/workflows/numpy_version.py`
USE_MIMALLOC=1 /opt/python/${cp}/bin/python setup.py build bdist_wheel
auditwheel repair dist/*-${cp}-linux_x86_64.whl
done
/opt/python/cp311-cp311/bin/python -m twine upload wheelhouse/*.whl
build_macos_13:
name: Build for macOS 13
runs-on: macOS-13
strategy:
max-parallel: 4
matrix:
python-version: [3.8, 3.9, "3.10", 3.11, 3.12]
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
lfs: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Deploy
continue-on-error: True
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m pip install twine wheel numpy==`python .github/workflows/numpy_version.py` setuptools
MACOSX_DEPLOYMENT_TARGET=10.14 KIWI_CPU_ARCH=x86_64 USE_MIMALLOC=1 python setup.py bdist_wheel
MACOSX_DEPLOYMENT_TARGET=10.14 KIWI_CPU_ARCH=arm64 USE_MIMALLOC=1 python setup.py bdist_wheel
twine upload dist/*
build_windows:
name: Build for Windows
runs-on: windows-2019
strategy:
max-parallel: 4
matrix:
python-version: [3.7, 3.8, 3.9, "3.10", 3.11, 3.12]
architecture: [x86, x64]
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
lfs: true
- name: Set up Python ${{ matrix.python-version }} ${{ matrix.architecture }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
- name: Deploy
continue-on-error: True
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m pip install --upgrade pip setuptools
python -m pip install twine wheel numpy==$(python .github/workflows/numpy_version.py)
$env:USE_MIMALLOC = 1; python setup.py bdist_wheel
twine upload dist/*
build_other_arch_old:
name: Build for manylinux (other arch, old)
runs-on: ubuntu-latest
strategy:
matrix:
arch: [aarch64, ppc64le]
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
lfs: true
- uses: bab2min/run-on-arch-action@use-custom-image
name: Deploy
id: runcmd
with:
image: quay.io/pypa/manylinux2014_${{ matrix.arch }}
githubToken: ${{ github.token }}
setup: |
mkdir -p "${PWD}/artifacts"
dockerRunArgs: |
--volume "${PWD}/artifacts:/artifacts"
env: |
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
for cp in cp36-cp36m cp37-cp37m cp38-cp38
do
/opt/python/${cp}/bin/python -m pip install wheel numpy==`/opt/python/${cp}/bin/python .github/workflows/numpy_version.py`
USE_MIMALLOC=1 /opt/python/${cp}/bin/python setup.py build bdist_wheel
auditwheel repair dist/*-${cp}-*.whl
done
mv wheelhouse/*.whl /artifacts/
- name: Upload wheels
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python3 -m pip install --upgrade pip setuptools
python3 -m pip install twine wheel
python3 -m twine upload artifacts/*.whl
build_other_arch:
name: Build for manylinux (other arch)
runs-on: ubuntu-latest
strategy:
matrix:
arch: [aarch64, ppc64le]
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
lfs: true
- uses: bab2min/run-on-arch-action@use-custom-image
name: Deploy
id: runcmd
with:
image: quay.io/pypa/manylinux2014_${{ matrix.arch }}
githubToken: ${{ github.token }}
setup: |
mkdir -p "${PWD}/artifacts"
dockerRunArgs: |
--volume "${PWD}/artifacts:/artifacts"
env: |
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
if [ "${{ matrix.arch }}" = "aarch64" ]; then
export CPS="cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312"
else
export CPS="cp39-cp39 cp310-cp310 cp311-cp311"
fi
for cp in $CPS
do
/opt/python/${cp}/bin/python -m pip install wheel numpy==`/opt/python/${cp}/bin/python .github/workflows/numpy_version.py`
USE_MIMALLOC=1 /opt/python/${cp}/bin/python setup.py build bdist_wheel
auditwheel repair dist/*-${cp}-*.whl
done
mv wheelhouse/*.whl /artifacts/
- name: Upload wheels
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python3 -m pip install --upgrade pip setuptools
python3 -m pip install twine wheel
python3 -m twine upload artifacts/*.whl