Skip to content

Commit 58ca00e

Browse files
authored
Merge pull request #85 from lindera:build_functions
Build_functions
2 parents a7cda32 + bae5746 commit 58ca00e

File tree

2 files changed

+137
-101
lines changed

2 files changed

+137
-101
lines changed

.github/workflows/release.yml

Lines changed: 136 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,18 @@ jobs:
7474
target: x86_64
7575
toolchain: [stable]
7676
features:
77-
# - value: "ipadic"
78-
# package_name: "lindera-py-ipadic"
79-
# package_description: "Python binding for Lindera with Japanese dictionary (IPADIC)"
80-
# - value: "unidic"
81-
# package_name: "lindera-py-unidic"
82-
# package_description: "Python binding for Lindera with Japanese dictionary (Unidic)"
83-
# - value: "ko-dic"
84-
# package_name: "lindera-py-ko-dic"
85-
# package_description: "Python binding for Lindera with Korean dictionary (ko-dic)"
86-
# - value: "cc-cedict"
87-
# package_name: "lindera-py-cc-cedict"
88-
# package_description: "Python binding for Lindera with CHinese dictionary (CC-CEDICT)"
77+
- value: "ipadic"
78+
package_name: "lindera-py-ipadic"
79+
package_description: "Python binding for Lindera with Japanese dictionary (IPADIC)"
80+
- value: "unidic"
81+
package_name: "lindera-py-unidic"
82+
package_description: "Python binding for Lindera with Japanese dictionary (Unidic)"
83+
- value: "ko-dic"
84+
package_name: "lindera-py-ko-dic"
85+
package_description: "Python binding for Lindera with Korean dictionary (ko-dic)"
86+
- value: "cc-cedict"
87+
package_name: "lindera-py-cc-cedict"
88+
package_description: "Python binding for Lindera with CHinese dictionary (CC-CEDICT)"
8989
- value: "cjk"
9090
package_name: "lindera-py"
9191
package_description: "Python binding for Lindera with CJK dictionaries (IPADIC, ko-dic, CC-CEDICT)"
@@ -99,24 +99,24 @@ jobs:
9999
with:
100100
python-version: 3.x
101101

102-
# - name: Generate pyproject.toml for each feature
103-
# run: |
104-
# # Make package name to Python package name conversion (hyphen to underscore)
105-
# PYTHON_PACKAGE_NAME=$(echo "${{ matrix.features.package_name }}" | sed 's/-/_/g')
106-
# # Copy the original pyproject.toml
107-
# cp pyproject.toml pyproject-${{ matrix.features.value }}.toml
108-
# # Replace package name and description
109-
# sed -i 's/name = "lindera_py"/name = "'${PYTHON_PACKAGE_NAME}'"/' pyproject-${{ matrix.features.value }}.toml
110-
# sed -i 's/description = ""/description = "${{ matrix.features.package_description }}"/' pyproject-${{ matrix.features.value }}.toml
111-
# # Confirm the generated file
112-
# echo "Generated pyproject-${{ matrix.features.value }}.toml:"
113-
# cat pyproject-${{ matrix.features.value }}.toml
102+
- name: Generate pyproject.toml for each feature
103+
run: |
104+
# Make package name to Python package name conversion (hyphen to underscore)
105+
PYTHON_PACKAGE_NAME=$(echo "${{ matrix.features.package_name }}" | sed 's/-/_/g')
106+
# Copy the original pyproject.toml
107+
cp pyproject.toml pyproject-${{ matrix.features.value }}.toml
108+
# Replace package name and description
109+
sed -i 's/name = "lindera_py"/name = "'${PYTHON_PACKAGE_NAME}'"/' pyproject-${{ matrix.features.value }}.toml
110+
sed -i 's/description = ""/description = "${{ matrix.features.package_description }}"/' pyproject-${{ matrix.features.value }}.toml
111+
# Confirm the generated file
112+
echo "Generated pyproject-${{ matrix.features.value }}.toml:"
113+
cat pyproject-${{ matrix.features.value }}.toml
114114
115115
- name: Build wheels
116116
uses: PyO3/maturin-action@v1
117117
with:
118118
target: ${{ matrix.platform.target }}
119-
args: --release --out dist --find-interpreter --features=${{ matrix.features.value }} #--manifest-path pyproject-${{ matrix.features.value }}.toml
119+
args: --release --out dist --find-interpreter --features=${{ matrix.features.value }} --manifest-path pyproject-${{ matrix.features.value }}.toml
120120
sccache: "false"
121121
manylinux: auto
122122
before-script-linux: "yum install openssl-devel devtoolset-10-libatomic-devel perl-IPC-Cmd -y"
@@ -139,18 +139,18 @@ jobs:
139139
# target: armv7
140140
toolchain: [stable]
141141
features:
142-
# - value: "ipadic"
143-
# package_name: "lindera-py-ipadic"
144-
# package_description: "Python binding for Lindera with Japanese dictionary (IPADIC)"
145-
# - value: "unidic"
146-
# package_name: "lindera-py-unidic"
147-
# package_description: "Python binding for Lindera with Japanese dictionary (Unidic)"
148-
# - value: "ko-dic"
149-
# package_name: "lindera-py-ko-dic"
150-
# package_description: "Python binding for Lindera with Korean dictionary (ko-dic)"
151-
# - value: "cc-cedict"
152-
# package_name: "lindera-py-cc-cedict"
153-
# package_description: "Python binding for Lindera with CHinese dictionary (CC-CEDICT)"
142+
- value: "ipadic"
143+
package_name: "lindera-py-ipadic"
144+
package_description: "Python binding for Lindera with Japanese dictionary (IPADIC)"
145+
- value: "unidic"
146+
package_name: "lindera-py-unidic"
147+
package_description: "Python binding for Lindera with Japanese dictionary (Unidic)"
148+
- value: "ko-dic"
149+
package_name: "lindera-py-ko-dic"
150+
package_description: "Python binding for Lindera with Korean dictionary (ko-dic)"
151+
- value: "cc-cedict"
152+
package_name: "lindera-py-cc-cedict"
153+
package_description: "Python binding for Lindera with CHinese dictionary (CC-CEDICT)"
154154
- value: "cjk"
155155
package_name: "lindera-py"
156156
package_description: "Python binding for Lindera with CJK dictionaries (IPADIC, ko-dic, CC-CEDICT)"
@@ -164,24 +164,24 @@ jobs:
164164
with:
165165
python-version: 3.x
166166

167-
# - name: Generate pyproject.toml for each feature
168-
# run: |
169-
# # Make package name to Python package name conversion (hyphen to underscore)
170-
# PYTHON_PACKAGE_NAME=$(echo "${{ matrix.features.package_name }}" | sed 's/-/_/g')
171-
# # Copy the original pyproject.toml
172-
# cp pyproject.toml pyproject-${{ matrix.features.value }}.toml
173-
# # Replace package name and description
174-
# sed -i 's/name = "lindera_py"/name = "'${PYTHON_PACKAGE_NAME}'"/' pyproject-${{ matrix.features.value }}.toml
175-
# sed -i 's/description = ""/description = "${{ matrix.features.package_description }}"/' pyproject-${{ matrix.features.value }}.toml
176-
# # Confirm the generated file
177-
# echo "Generated pyproject-${{ matrix.features.value }}.toml:"
178-
# cat pyproject-${{ matrix.features.value }}.toml
167+
- name: Generate pyproject.toml for each feature
168+
run: |
169+
# Make package name to Python package name conversion (hyphen to underscore)
170+
PYTHON_PACKAGE_NAME=$(echo "${{ matrix.features.package_name }}" | sed 's/-/_/g')
171+
# Copy the original pyproject.toml
172+
cp pyproject.toml pyproject-${{ matrix.features.value }}.toml
173+
# Replace package name and description
174+
sed -i 's/name = "lindera_py"/name = "'${PYTHON_PACKAGE_NAME}'"/' pyproject-${{ matrix.features.value }}.toml
175+
sed -i 's/description = ""/description = "${{ matrix.features.package_description }}"/' pyproject-${{ matrix.features.value }}.toml
176+
# Confirm the generated file
177+
echo "Generated pyproject-${{ matrix.features.value }}.toml:"
178+
cat pyproject-${{ matrix.features.value }}.toml
179179
180180
- name: Build wheels
181181
uses: PyO3/maturin-action@v1
182182
with:
183183
target: ${{ matrix.platform.target }}
184-
args: --release --out dist --find-interpreter --features=${{ matrix.features.value }} #--manifest-path pyproject-${{ matrix.features.value }}.toml
184+
args: --release --out dist --find-interpreter --features=${{ matrix.features.value }} --manifest-path pyproject-${{ matrix.features.value }}.toml
185185
sccache: "false"
186186
manylinux: auto
187187
before-script-linux: "apt-get update && apt-get install libssl-dev pkg-config -y"
@@ -202,18 +202,18 @@ jobs:
202202
target: x64
203203
toolchain: [stable]
204204
features:
205-
# - value: "ipadic"
206-
# package_name: "lindera-py-ipadic"
207-
# package_description: "Python binding for Lindera with Japanese dictionary (IPADIC)"
208-
# - value: "unidic"
209-
# package_name: "lindera-py-unidic"
210-
# package_description: "Python binding for Lindera with Japanese dictionary (Unidic)"
211-
# - value: "ko-dic"
212-
# package_name: "lindera-py-ko-dic"
213-
# package_description: "Python binding for Lindera with Korean dictionary (ko-dic)"
214-
# - value: "cc-cedict"
215-
# package_name: "lindera-py-cc-cedict"
216-
# package_description: "Python binding for Lindera with CHinese dictionary (CC-CEDICT)"
205+
- value: "ipadic"
206+
package_name: "lindera-py-ipadic"
207+
package_description: "Python binding for Lindera with Japanese dictionary (IPADIC)"
208+
- value: "unidic"
209+
package_name: "lindera-py-unidic"
210+
package_description: "Python binding for Lindera with Japanese dictionary (Unidic)"
211+
- value: "ko-dic"
212+
package_name: "lindera-py-ko-dic"
213+
package_description: "Python binding for Lindera with Korean dictionary (ko-dic)"
214+
- value: "cc-cedict"
215+
package_name: "lindera-py-cc-cedict"
216+
package_description: "Python binding for Lindera with CHinese dictionary (CC-CEDICT)"
217217
- value: "cjk"
218218
package_name: "lindera-py"
219219
package_description: "Python binding for Lindera with CJK dictionaries (IPADIC, ko-dic, CC-CEDICT)"
@@ -228,22 +228,22 @@ jobs:
228228
python-version: 3.x
229229
architecture: ${{ matrix.platform.target }}
230230

231-
# - name: Generate pyproject.toml for each feature (Windows)
232-
# run: |
233-
# $PYTHON_PACKAGE_NAME = "${{ matrix.features.package_name }}".Replace("-", "_")
234-
# Copy-Item pyproject.toml pyproject-${{ matrix.features.value }}.toml
235-
# (Get-Content pyproject-${{ matrix.features.value }}.toml) -replace 'name = "lindera_py"', "name = `"$PYTHON_PACKAGE_NAME`"" | Set-Content pyproject-${{ matrix.features.value }}.toml
236-
# (Get-Content pyproject-${{ matrix.features.value }}.toml) -replace 'description = ""', 'description = "${{ matrix.features.package_description }}"' | Set-Content pyproject-${{ matrix.features.value }}.toml
237-
# # Confirm the generated file
238-
# Write-Host "Generated pyproject-${{ matrix.features.value }}.toml:"
239-
# Get-Content pyproject-${{ matrix.features.value }}.toml
240-
# shell: powershell
231+
- name: Generate pyproject.toml for each feature (Windows)
232+
run: |
233+
$PYTHON_PACKAGE_NAME = "${{ matrix.features.package_name }}".Replace("-", "_")
234+
Copy-Item pyproject.toml pyproject-${{ matrix.features.value }}.toml
235+
(Get-Content pyproject-${{ matrix.features.value }}.toml) -replace 'name = "lindera_py"', "name = `"$PYTHON_PACKAGE_NAME`"" | Set-Content pyproject-${{ matrix.features.value }}.toml
236+
(Get-Content pyproject-${{ matrix.features.value }}.toml) -replace 'description = ""', 'description = "${{ matrix.features.package_description }}"' | Set-Content pyproject-${{ matrix.features.value }}.toml
237+
# Confirm the generated file
238+
Write-Host "Generated pyproject-${{ matrix.features.value }}.toml:"
239+
Get-Content pyproject-${{ matrix.features.value }}.toml
240+
shell: powershell
241241

242242
- name: Build wheels
243243
uses: PyO3/maturin-action@v1
244244
with:
245245
target: ${{ matrix.platform.target }}
246-
args: --release --out dist --find-interpreter --features=${{ matrix.features.value }} #--manifest-path pyproject-${{ matrix.features.value }}.toml
246+
args: --release --out dist --find-interpreter --features=${{ matrix.features.value }} --manifest-path pyproject-${{ matrix.features.value }}.toml
247247
sccache: "false"
248248

249249
- name: Upload wheels
@@ -264,18 +264,18 @@ jobs:
264264
target: aarch64
265265
toolchain: [stable]
266266
features:
267-
# - value: "ipadic"
268-
# package_name: "lindera-py-ipadic"
269-
# package_description: "Python binding for Lindera with Japanese dictionary (IPADIC)"
270-
# - value: "unidic"
271-
# package_name: "lindera-py-unidic"
272-
# package_description: "Python binding for Lindera with Japanese dictionary (Unidic)"
273-
# - value: "ko-dic"
274-
# package_name: "lindera-py-ko-dic"
275-
# package_description: "Python binding for Lindera with Korean dictionary (ko-dic)"
276-
# - value: "cc-cedict"
277-
# package_name: "lindera-py-cc-cedict"
278-
# package_description: "Python binding for Lindera with CHinese dictionary (CC-CEDICT)"
267+
- value: "ipadic"
268+
package_name: "lindera-py-ipadic"
269+
package_description: "Python binding for Lindera with Japanese dictionary (IPADIC)"
270+
- value: "unidic"
271+
package_name: "lindera-py-unidic"
272+
package_description: "Python binding for Lindera with Japanese dictionary (Unidic)"
273+
- value: "ko-dic"
274+
package_name: "lindera-py-ko-dic"
275+
package_description: "Python binding for Lindera with Korean dictionary (ko-dic)"
276+
- value: "cc-cedict"
277+
package_name: "lindera-py-cc-cedict"
278+
package_description: "Python binding for Lindera with CHinese dictionary (CC-CEDICT)"
279279
- value: "cjk"
280280
package_name: "lindera-py"
281281
package_description: "Python binding for Lindera with CJK dictionaries (IPADIC, ko-dic, CC-CEDICT)"
@@ -289,24 +289,24 @@ jobs:
289289
with:
290290
python-version: 3.x
291291

292-
# - name: Generate pyproject.toml for each feature
293-
# run: |
294-
# # Make package name to Python package name conversion (hyphen to underscore)
295-
# PYTHON_PACKAGE_NAME=$(echo "${{ matrix.features.package_name }}" | sed 's/-/_/g')
296-
# # Copy the original pyproject.toml
297-
# cp pyproject.toml pyproject-${{ matrix.features.value }}.toml
298-
# # Replace package name and description
299-
# sed -i '' 's/name = "lindera_py"/name = "'${PYTHON_PACKAGE_NAME}'"/' pyproject-${{ matrix.features.value }}.toml
300-
# sed -i '' 's/description = ""/description = "${{ matrix.features.package_description }}"/' pyproject-${{ matrix.features.value }}.toml
301-
# # Confirm the generated file
302-
# echo "Generated pyproject-${{ matrix.features.value }}.toml:"
303-
# cat pyproject-${{ matrix.features.value }}.toml
292+
- name: Generate pyproject.toml for each feature
293+
run: |
294+
# Make package name to Python package name conversion (hyphen to underscore)
295+
PYTHON_PACKAGE_NAME=$(echo "${{ matrix.features.package_name }}" | sed 's/-/_/g')
296+
# Copy the original pyproject.toml
297+
cp pyproject.toml pyproject-${{ matrix.features.value }}.toml
298+
# Replace package name and description
299+
sed -i '' 's/name = "lindera_py"/name = "'${PYTHON_PACKAGE_NAME}'"/' pyproject-${{ matrix.features.value }}.toml
300+
sed -i '' 's/description = ""/description = "${{ matrix.features.package_description }}"/' pyproject-${{ matrix.features.value }}.toml
301+
# Confirm the generated file
302+
echo "Generated pyproject-${{ matrix.features.value }}.toml:"
303+
cat pyproject-${{ matrix.features.value }}.toml
304304
305305
- name: Build wheels
306306
uses: PyO3/maturin-action@v1
307307
with:
308308
target: ${{ matrix.platform.target }}
309-
args: --release --out dist --find-interpreter --features=${{ matrix.features.value }} #--manifest-path pyproject-${{ matrix.features.value }}.toml
309+
args: --release --out dist --find-interpreter --features=${{ matrix.features.value }} --manifest-path pyproject-${{ matrix.features.value }}.toml
310310
sccache: "false"
311311

312312
- name: Upload wheels
@@ -355,14 +355,50 @@ jobs:
355355
with:
356356
subject-path: "wheels-*/*"
357357

358-
- name: Publish to PyPI
358+
- name: Publish to PyPI - lindera-py
359+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
360+
uses: PyO3/maturin-action@v1
361+
env:
362+
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
363+
with:
364+
command: upload
365+
args: --non-interactive --skip-existing wheels-lindera-py-*/*
366+
367+
- name: Publish to PyPI - lindera-py-ipadic
368+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
369+
uses: PyO3/maturin-action@v1
370+
env:
371+
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
372+
with:
373+
command: upload
374+
args: --non-interactive --skip-existing wheels-lindera-py-ipadic-*/*
375+
376+
- name: Publish to PyPI - lindera-py-unidic
377+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
378+
uses: PyO3/maturin-action@v1
379+
env:
380+
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
381+
with:
382+
command: upload
383+
args: --non-interactive --skip-existing wheels-lindera-py-unidic-*/*
384+
385+
- name: Publish to PyPI - lindera-py-ko-dic
386+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
387+
uses: PyO3/maturin-action@v1
388+
env:
389+
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
390+
with:
391+
command: upload
392+
args: --non-interactive --skip-existing wheels-lindera-py-ko-dic-*/*
393+
394+
- name: Publish to PyPI - lindera-py-cc-cedict
359395
if: ${{ startsWith(github.ref, 'refs/tags/') }}
360396
uses: PyO3/maturin-action@v1
361397
env:
362398
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
363399
with:
364400
command: upload
365-
args: --non-interactive --skip-existing wheels-*/*
401+
args: --non-interactive --skip-existing wheels-lindera-py-cc-cedict-*/*
366402

367403
- name: Create GitHub Release
368404
id: create_release

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "lindera_py"
3-
version = "0.44.1"
3+
version = "0.45.0"
44
description = ""
55
authors = ["Minoru Osuka <[email protected]>"]
66
license = "MIT"

0 commit comments

Comments
 (0)