Skip to content

Commit 4497c86

Browse files
committed
add github actions CI for linux
1 parent 9089817 commit 4497c86

File tree

4 files changed

+81
-3
lines changed

4 files changed

+81
-3
lines changed

.github/workflows/build.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ build ]
6+
pull_request:
7+
branches: [ build ]
8+
workflow_dispatch:
9+
# gh api repos/:owner/:repo/actions/workflows/build.yml/dispatches -F ref=main
10+
11+
jobs:
12+
13+
build-linux:
14+
runs-on: ubuntu-18.04
15+
if: true
16+
steps:
17+
- uses: actions/checkout@v2
18+
with:
19+
submodules: 'recursive'
20+
- run: |
21+
building/dockcross-manylinux2014-x64 bash building/build-wheel-dockcross.sh manylinux2014_x86_64
22+
# cp dist/* wheelhouse/
23+
ls -al wheelhouse/
24+
- uses: actions/upload-artifact@v2
25+
with:
26+
name: wheels
27+
path: wheelhouse/*
28+
29+
build-macos:
30+
runs-on: macos-10.15
31+
if: false
32+
env:
33+
MACOSX_DEPLOYMENT_TARGET: 10.9
34+
steps:
35+
- uses: actions/checkout@v2
36+
with:
37+
submodules: 'recursive'
38+
- name: Dependencies
39+
run: |
40+
python3 -m pip install --upgrade setuptools wheel scikit-build cmake ninja
41+
brew install automake
42+
brew install autoconf
43+
brew install libtool
44+
- run: |
45+
python3 setup.py bdist_wheel
46+
ls -al dist/
47+
- uses: actions/upload-artifact@v2
48+
with:
49+
name: wheels
50+
path: dist/*
51+
52+
build-windows:
53+
runs-on: windows-2019
54+
if: false
55+
defaults:
56+
run:
57+
shell: bash
58+
steps:
59+
- uses: actions/upload-artifact@v2
60+
with:
61+
name: wheels
62+
path: main/dist/*

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Wav2Vec2 STT Python
2+
3+
> **Alpha Software**
4+
5+
## Author
6+
7+
* David Zurow ([@daanzu](https://github.com/daanzu))
8+
9+
## License
10+
11+
This project is licensed under the GNU Affero General Public License v3 (AGPL-3.0-or-later). See the [LICENSE file](LICENSE) for details. If this license is problematic for you, please contact me.

building/build-wheel-dockcross.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ if [ -z "$WHEEL_PLAT" ] || [ -z "$PYTHON_EXE" ]; then
1010
exit 1
1111
fi
1212

13-
# $PYTHON_EXE -m pip install -r requirements-build.txt
14-
export TORCH_CMAKE_PREFIX_PATH=$(readlink -m _skbuild/linux-x86_64-3.8/libtorch)
13+
$PYTHON_EXE -m pip install -f https://download.pytorch.org/whl/torch_stable.html torch==1.9.0+cpu
14+
$PYTHON_EXE -m pip install -r requirements-build.txt
15+
export TORCH_CMAKE_PREFIX_PATH=$($PYTHON_EXE -c "import torch;print(torch.utils.cmake_prefix_path)")
16+
# export TORCH_CMAKE_PREFIX_PATH=$(readlink -m _skbuild/linux-x86_64-3.8/libtorch/share/cmake)
1517
$PYTHON_EXE setup.py bdist_wheel
1618

1719
mkdir -p wheelhouse
18-
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TORCH_CMAKE_PREFIX_PATH/lib
20+
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TORCH_CMAKE_PREFIX_PATH/../../lib
1921
for whl in dist/*.whl; do auditwheel repair $whl --plat $WHEEL_PLAT -w wheelhouse/; done

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ def find_version(*file_paths):
6161
with open(os.path.join(here, 'README.md')) as f:
6262
long_description = f.read()
6363

64+
if not os.path.exists('native/simplectc/CMakeLists.txt'):
65+
subprocess.check_call(['git', 'submodule', 'update', '--init', 'native/simplectc/'])
66+
6467
torch_cmake_prefix_path = os.environ.get('TORCH_CMAKE_PREFIX_PATH') \
6568
or subprocess.check_output(['python', '-c', 'import torch;print(torch.utils.cmake_prefix_path)'], text=True).strip()
6669

0 commit comments

Comments
 (0)