generated from aarnphm/bazix
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
infra: finalizing some steps before releasing (#42)
* infra: finalizing some steps before releasing Signed-off-by: Aaron <[email protected]> * chore: setup python for cibuildwheel Signed-off-by: Aaron <[email protected]> * chore: no need to setup clang since hermetic chain Signed-off-by: Aaron <[email protected]> * chore: remove maven setup Signed-off-by: Aaron <[email protected]> * chore: ok I just now learn you can install clang with pip Signed-off-by: Aaron <[email protected]> * chore: use g++ on CI Signed-off-by: Aaron <[email protected]> * chore: ok env should be set fine now Signed-off-by: Aaron <[email protected]> * chore: ok we will get them next time Signed-off-by: Aaron <[email protected]> * finals: add docstring and run yamllint Signed-off-by: Aaron <[email protected]> * fix: sanity check Signed-off-by: Aaron <[email protected]> --------- Signed-off-by: Aaron <[email protected]>
- Loading branch information
Showing
30 changed files
with
403 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
name: wheels | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
|
@@ -8,20 +7,16 @@ on: | |
pull_request: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: wheels-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
LINES: 200 | ||
COLUMNS: 200 | ||
|
||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#defaultsrun | ||
defaults: | ||
run: | ||
shell: bash --noprofile --norc -exo pipefail {0} | ||
|
||
jobs: | ||
build-sdist: | ||
name: Build source distribution | ||
|
@@ -43,19 +38,63 @@ jobs: | |
pip install build | ||
python -m build --sdist | ||
- name: Test built sdist | ||
if: ${{ github.event_name == 'pull_request' }} | ||
run: | | ||
python -m venv venv | ||
source venv/bin/activate | ||
pip install dist/*.tar.gz && python -c "import whispercpp as w;print(dir(w.api)); print(dir(w.audio));" | ||
- name: Upload to PyPI | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | ||
run: | | ||
pip install twine | ||
twine upload dist/* --repository pypi --verbose | ||
build-arm-wheels: | ||
name: Build ARM wheels for ${{ matrix.python[1] }}-${{ matrix.platform[0] }} | ||
runs-on: ${{ matrix.platform[1] }} | ||
if: ${{ failure() }} # Disable this for now. We will tackle this later. | ||
timeout-minutes: 90 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python: | ||
- ["cp38", "3.8"] | ||
- ["cp39", "3.9"] | ||
- ["cp310", "3.10"] | ||
- ["cp311", "3.11"] | ||
platform: | ||
- [manylinux_aarch64, ubuntu-latest] | ||
- [macosx_arm64, macos-latest] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # fetch all tags and branches | ||
- name: Setup CI | ||
uses: ./.github/actions/setup-repo | ||
with: | ||
python-version: ${{ matrix.python[1] }} | ||
- name: Set up QEMU | ||
if: runner.os == 'Linux' | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: all | ||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.platform[0] }} | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ matrix.python[0] }}-${{ startsWith(matrix.platform[0], 'macosx') | ||
&& 'macosx' || matrix.platform[0] }} | ||
path: ./wheelhouse/*.whl | ||
build-wheel: | ||
name: Build wheels for python${{ matrix.python-version }} (${{ matrix.os }}) | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 20 | ||
timeout-minutes: 90 | ||
if: github.repository_owner == 'aarnphm' # Don't run on fork repository | ||
strategy: | ||
fail-fast: false | ||
|
@@ -65,7 +104,6 @@ jobs: | |
exclude: | ||
- os: "windows-latest" | ||
- python-version: "3.11.2" | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
@@ -80,14 +118,17 @@ jobs: | |
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: all | ||
- name: Set up Clang [Linux] | ||
if: runner.os == 'Linux' | ||
uses: egor-tensin/setup-clang@v1 | ||
- name: Running update requirements | ||
run: bazel run pypi_update | ||
- name: Building wheels | ||
if: github.event_name == 'pull_request' | ||
run: bazel build whispercpp_wheel | ||
- name: Test built wheel | ||
if: ${{ github.event_name == 'pull_request' }} | ||
run: | | ||
python -m venv venv | ||
source venv/bin/activate | ||
pip install $(bazel info bazel-bin)/*.whl && python -c "import whispercpp as w;print(dir(w.api)); print(dir(w.audio));" | ||
- name: Retrieving versions | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | ||
id: get-info | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,3 +130,6 @@ dmypy.json | |
|
||
# bazel generated files | ||
bazel-* | ||
|
||
# bun lock file | ||
bun.lockb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.