-
Notifications
You must be signed in to change notification settings - Fork 52
109 lines (102 loc) · 3.03 KB
/
manylinux.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
name: Build manylinux wheels
on: [push]
jobs:
build_sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: |
3.8
3.9
3.10
3.11
3.12
3.13
- name: Cache mecab
id: cache-mecab
uses: actions/cache@v3
with:
path: mecab
key: mecab-build
- name: install MeCab
if: steps.cache-mecab.outputs.cache-hit != 'true'
run: |
git clone --depth=1 https://github.com/taku910/mecab.git
cd mecab/mecab
./configure --enable-utf8-only
make
sudo make install
cd ../..
- name: build sdist
run: |
python -m pip install --upgrade pip
pip install twine setuptools-scm
python setup.py sdist
- name: upload to pypi if tagged
if: startsWith(github.ref, 'refs/tags') && github.repository_owner == 'polm'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
twine upload dist/mecab*.tar.gz
build_manylinux:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [x86_64, aarch64]
env:
arch: ${{ matrix.arch }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: |
3.8
3.9
3.10
3.11
3.12
3.13
- name: Cache mecab
id: cache-mecab
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/mecab_${{ matrix.arch }}
key: mecab-build-${{ matrix.arch }}
# The verbosity and indirection here seems to be a required side effect of
# using Docker.
- name: Build x86_64 MeCab
if: matrix.arch == 'x86_64' && steps.cache-mecab.outputs.cache-hit != 'true'
uses: ./.github/workflows/actions/build-manylinux/
- name: Build x86_64 wheels
if: matrix.arch == 'x86_64'
uses: ./.github/workflows/actions/build-wheels/
- name: Set up QEMU
if: matrix.arch == 'aarch64'
uses: docker/setup-qemu-action@v1
- name: Build aarch64 MeCab
if: matrix.arch == 'aarch64' && steps.cache-mecab.outputs.cache-hit != 'true'
uses: ./.github/workflows/actions_aarch64/build_manylinux2014/
- name: Build aarch64 wheels
if: matrix.arch == 'aarch64'
uses: ./.github/workflows/actions_aarch64/build_wheels/
- name: Upload Wheels
uses: actions/upload-artifact@v4
with:
name: manylinux-wheels-${{ matrix.arch }}
path: manylinux-wheels
- name: Publish to PyPI if tagged
if: startsWith(github.ref, 'refs/tags') && github.repository_owner == 'polm'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python --version
pip --version
python -m pip install --upgrade pip
pip install twine setuptools-scm
twine upload manylinux-wheels/mecab*whl