Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh actionsで追加およびmanylinuxでビルドできるように変更 #693

Open
wants to merge 33 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
e3a6a01
Create CI.yml
Nov 1, 2023
88d3565
Merge branch 'VOICEVOX:main' into patch-1
tuna2134 Nov 13, 2023
c3ffca8
Merge branch 'VOICEVOX:main' into patch-1
tuna2134 Nov 23, 2023
5f8635d
Merge pull request #3 from tuna2134/patch-1
tuna2134 Nov 23, 2023
670fa97
Update CI.yml
tuna2134 Nov 23, 2023
73b949d
Update CI.yml
tuna2134 Nov 23, 2023
f1998ac
勝利宣言
tuna2134 Nov 23, 2023
6c3042a
Update CI.yml
tuna2134 Nov 23, 2023
ee0180f
Update CI.yml
tuna2134 Nov 23, 2023
f632406
Update CI.yml
tuna2134 Nov 23, 2023
0e4482d
Merge pull request #4 from tuna2134/main
tuna2134 Nov 23, 2023
b9dc52d
Update CI.yml
tuna2134 Nov 23, 2023
eb1baf8
Merge branch 'VOICEVOX:main' into patch-1
tuna2134 Nov 23, 2023
0c5bf40
Update CI.yml
tuna2134 Nov 23, 2023
c02ec70
Merge branch 'VOICEVOX:main' into main
tuna2134 Nov 23, 2023
c4adad1
Update CI.yml
tuna2134 Nov 23, 2023
e09ed7a
Update CI.yml
tuna2134 Nov 23, 2023
f03081b
Merge pull request #5 from tuna2134/main
tuna2134 Nov 23, 2023
8eb71d9
Update pyproject.toml
tuna2134 Nov 23, 2023
4d37b05
Update CI.yml
tuna2134 Nov 23, 2023
1b33050
Update CI.yml
tuna2134 Nov 23, 2023
9e4bd97
Remove abi3
tuna2134 Nov 24, 2023
db0a738
Remove sdist
tuna2134 Nov 24, 2023
d62c18e
Update Cargo.toml
tuna2134 Nov 24, 2023
889664d
manylinuxwo
tuna2134 Nov 25, 2023
76f54d5
pathcelf有効にしてみた
tuna2134 Nov 28, 2023
66db699
Merge pull request #6 from tuna2134/patchelf
tuna2134 Nov 28, 2023
e3fd017
Merge branch 'VOICEVOX:main' into patch-2
tuna2134 Nov 28, 2023
f483ab1
Merge pull request #7 from tuna2134/main
tuna2134 Nov 28, 2023
5475bdc
Merge branch 'VOICEVOX:main' into patch-2
tuna2134 Dec 26, 2023
4d03757
fix: linuxの時のみビルド
tuna2134 Dec 26, 2023
a3a342b
Merge pull request #8 from tuna2134/patch-1
tuna2134 Dec 28, 2023
c6c7a51
Merge branch 'VOICEVOX:main' into patch-2
tuna2134 May 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
142 changes: 142 additions & 0 deletions .github/workflows/CI.yml
Copy link
Member

@Hiroshiba Hiroshiba Jan 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ライブラリをビルドするコードはbuild_and_deploy.ymlに固まっているのですが、こちらに移すことは可能そうでしょうか・・・? 👀
おそらくほぼ同じコードをビルドしているので、コード量やビルド時間をぐっと減らせそうなのですが、どうでしょうか・・・?

ビルドしているのはこのあたりです↓

- name: build voicevox_core_python_api
if: matrix.whl_local_version
id: build-voicevox-core-python-api
run: |
rm -rf ./target/wheels
pip install --upgrade poetry
poetry config virtualenvs.create false
(cd crates/voicevox_core_python_api && poetry install --with dev)
function build() {
maturin build --manifest-path ./crates/voicevox_core_python_api/Cargo.toml --features ${{ matrix.features }}, --target ${{ matrix.target }} --release
}
if ${{ !inputs.is_production }}; then
build
else
build > /dev/null 2>&1
fi
echo "whl=$(find ./target/wheels -type f)" >> "$GITHUB_OUTPUT"
env:
ORT_USE_CUDA: ${{ matrix.use_cuda }}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

別のことで忙しくて返信が遅れてしまいました!
できそうかと思われます。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

お久しぶりです!こちらも別タスクが忙しかったので大丈夫です!
もしよければ完成まで進められると嬉しいです!!

Copy link
Author

@tuna2134 tuna2134 May 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

今からまとめてみようと思います、、、!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ありがとうございます、お待ちしてます・・・!

Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
# This file is autogenerated by maturin v1.3.1
# To update, run
#
# maturin generate-ci github
#
name: CI

on:
workflow_dispatch:
inputs:
version:
description: "バージョン情報(A.BB.C / A.BB.C-preview.D)"
required: true
release:
types:
- published

env:
VERSION: ${{ github.event.release.tag_name || inputs.version || '0.0.0' }}

permissions:
contents: read

jobs:
version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install cargo-binstall
uses: taiki-e/install-action@cargo-binstall
- name: Install cargo-edit
run: cargo binstall cargo-edit@^0.11 --no-confirm --log-level debug
- name: set cargo version
run: |
cargo set-version "$VERSION" --exclude voicevox_core_python_api --exclude downloader --exclude xtask
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: projects
path: ./

linux:
runs-on: ubuntu-latest
needs: version
strategy:
matrix:
target: [x86_64, aarch64]
steps:
- uses: actions/download-artifact@v3
with:
name: projects
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --locked --manifest-path crates/voicevox_core_python_api/Cargo.toml --find-interpreter
sccache: 'true'
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist

windows:
runs-on: windows-latest
needs: version
strategy:
matrix:
target: [x64, x86]
steps:
- uses: actions/download-artifact@v3
with:
name: projects
- uses: actions/setup-python@v4
with:
python-version: '3.10'
architecture: ${{ matrix.target }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --locked --manifest-path crates/voicevox_core_python_api/Cargo.toml --find-interpreter
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist

macos:
runs-on: macos-latest
needs: version
strategy:
matrix:
target: [x86_64]
steps:
- uses: actions/download-artifact@v3
with:
name: projects
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- uses: dtolnay/rust-toolchain@stable
- run: |
pip install --upgrade poetry
poetry config virtualenvs.create false
(cd crates/voicevox_core_python_api && poetry install --with dev)
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --locked --manifest-path crates/voicevox_core_python_api/Cargo.toml --find-interpreter
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist

release:
name: Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [linux, windows, macos]
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v3
with:
name: wheels
path: dist/
- name: Publish to PyPI
uses: PyO3/maturin-action@v1
with:
command: upload
args: --non-interactive --skip-existing dist/*
env:
MATURIN_REPOSITORY_URL: https://test.pypi.org/legacy/
2 changes: 1 addition & 1 deletion crates/voicevox_core_python_api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ directml = ["voicevox_core/directml"]
camino.workspace = true
easy-ext.workspace = true
log.workspace = true
pyo3 = { workspace = true, features = ["abi3-py38", "extension-module"] }
pyo3 = { workspace = true, features = ["extension-module"] }
pyo3-asyncio = { workspace = true, features = ["tokio-runtime"] }
pyo3-log.workspace = true
serde = { workspace = true, features = ["derive"] }
Expand Down
49 changes: 34 additions & 15 deletions crates/voicevox_core_python_api/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions crates/voicevox_core_python_api/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
name = "voicevox_core"
name = "voicevox"
requires-python = ">=3.8"
dependencies = ["pydantic>=2.5.2,<3"]
description = "VOICEVOX CORE の Python バインディングです。"
Expand Down Expand Up @@ -28,7 +28,7 @@ executionEnvironments = [{ root = "python/test" }, { root = "python" }]
[tool.maturin]
module-name = "voicevox_core._rust"
bindings = "pyo3"
skip-auditwheel = true # Linuxでlibonnxruntime.so.*の不在を許してもらう
skip-auditwheel = false # Linuxでlibonnxruntime.so.*の不在を許してもらう
python-source = "python"

[tool.poetry]
Expand All @@ -48,7 +48,8 @@ pydata-sphinx-theme = "0.14.1"
sphinx-autoapi = "3.0.0"

[tool.poetry.group.dev.dependencies]
maturin = "1.3.1"
maturin = "^1.3.2"
patchelf = {version = "^0.17.2.1", platform = "linux"}

[tool.poetry.group.test.dependencies]
pytest = "7.3.1"
Expand Down
Loading